Commit 15e08389 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

IMediaLibrary: Allow show/movie to be fetched by ID

parent e791cdc3
......@@ -263,7 +263,9 @@ class IMediaLibrary
virtual Query<IMedia> videoFiles( const QueryParameters* params = nullptr ) const = 0;
virtual AlbumPtr album( int64_t id ) const = 0;
virtual Query<IAlbum> albums( const QueryParameters* params = nullptr ) const = 0;
virtual ShowPtr show( int64_t id ) const = 0;
virtual ShowPtr show( const std::string& name ) const = 0;
virtual MoviePtr movie( int64_t id ) const = 0;
virtual MoviePtr movie( const std::string& title ) const = 0;
virtual ArtistPtr artist( int64_t id ) const = 0;
/**
......
......@@ -559,6 +559,11 @@ GenrePtr MediaLibrary::genre( int64_t id ) const
return Genre::fetch( this, id );
}
ShowPtr MediaLibrary::show( int64_t id ) const
{
return Show::fetch( this, id );
}
ShowPtr MediaLibrary::show( const std::string& name ) const
{
static const std::string req = "SELECT * FROM " + policy::ShowTable::Name
......@@ -571,6 +576,11 @@ std::shared_ptr<Show> MediaLibrary::createShow( const std::string& name )
return Show::create( this, name );
}
MoviePtr MediaLibrary::movie( int64_t id ) const
{
return Movie::fetch( this, id );
}
MoviePtr MediaLibrary::movie( const std::string& title ) const
{
static const std::string req = "SELECT * FROM " + policy::MovieTable::Name
......
......@@ -93,9 +93,11 @@ class MediaLibrary : public IMediaLibrary, public IDeviceListerCb
virtual Query<IGenre> genres( const QueryParameters* params ) const override;
virtual GenrePtr genre( int64_t id ) const override;
virtual ShowPtr show( int64_t id ) const override;
virtual ShowPtr show( const std::string& name ) const override;
std::shared_ptr<Show> createShow( const std::string& name );
virtual MoviePtr movie( int64_t id ) const override;
virtual MoviePtr movie( const std::string& title ) const override;
std::shared_ptr<Movie> createMovie( Media& media, const std::string& title );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment