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

MediaLibrary: Don't expose an artist getter from name.

Always use ID or listings
parent e6e8b253
......@@ -113,7 +113,7 @@ class IMediaLibrary
virtual std::vector<AlbumPtr> albums() = 0;
virtual ShowPtr show( const std::string& name ) = 0;
virtual MoviePtr movie( const std::string& title ) = 0;
virtual ArtistPtr artist( const std::string& name ) = 0;
virtual ArtistPtr artist( unsigned int id ) = 0;
virtual std::vector<ArtistPtr> artists() const = 0;
/**
......
......@@ -316,7 +316,12 @@ std::shared_ptr<Movie> MediaLibrary::createMovie( const std::string& title )
return Movie::create( m_dbConnection.get(), title );
}
ArtistPtr MediaLibrary::artist(const std::string &name)
ArtistPtr MediaLibrary::artist(unsigned int id)
{
return Artist::fetch( m_dbConnection.get(), id );
}
ArtistPtr MediaLibrary::artist( const std::string& name )
{
static const std::string req = "SELECT * FROM " + policy::ArtistTable::Name
+ " WHERE name = ?";
......
......@@ -72,7 +72,8 @@ class MediaLibrary : public IMediaLibrary
virtual MoviePtr movie( const std::string& title ) override;
std::shared_ptr<Movie> createMovie( const std::string& title );
virtual ArtistPtr artist( const std::string& name ) override;
virtual ArtistPtr artist( unsigned int id ) override;
ArtistPtr artist( const std::string& name );
std::shared_ptr<Artist> createArtist( const std::string& name );
virtual std::vector<ArtistPtr> artists() const override;
......
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