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

IMediaLibrary: Provide a genre getter

parent 0f5c7df9
......@@ -152,7 +152,7 @@ class IMediaLibrary
* @param desc If true, the provided sorting criteria will be reversed.
*/
virtual std::vector<GenrePtr> genres( medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false ) const = 0;
virtual GenrePtr genre( int64_t id ) const = 0;
/***
* Playlists
*/
......
......@@ -322,6 +322,11 @@ std::vector<GenrePtr> MediaLibrary::genres( medialibrary::SortingCriteria sort,
return Genre::listAll( this, sort, desc );
}
GenrePtr MediaLibrary::genre(int64_t id) const
{
return Genre::fetch( this, id );
}
ShowPtr MediaLibrary::show( const std::string& name ) const
{
static const std::string req = "SELECT * FROM " + policy::ShowTable::Name
......
......@@ -72,6 +72,7 @@ class MediaLibrary : public IMediaLibrary
virtual std::vector<AlbumPtr> albums(medialibrary::SortingCriteria sort, bool desc) const override;
virtual std::vector<GenrePtr> genres( medialibrary::SortingCriteria sort, bool desc ) const override;
virtual GenrePtr genre( int64_t id ) const override;
virtual ShowPtr show( const std::string& name ) const override;
std::shared_ptr<Show> createShow( const std::string& name );
......
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