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

MediaLibrary: Add missing const

parent a21b8aa3
......@@ -131,13 +131,13 @@ class IMediaLibrary
virtual LabelPtr createLabel( const std::string& label ) = 0;
virtual bool deleteLabel( LabelPtr label ) = 0;
virtual std::vector<MediaPtr> audioFiles( medialibrary::SortingCriteria sort, bool desc ) = 0;
virtual std::vector<MediaPtr> videoFiles( medialibrary::SortingCriteria sort, bool desc ) = 0;
virtual AlbumPtr album( unsigned int id ) = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort, bool desc ) = 0;
virtual ShowPtr show( const std::string& name ) = 0;
virtual MoviePtr movie( const std::string& title ) = 0;
virtual ArtistPtr artist( unsigned int id ) = 0;
virtual std::vector<MediaPtr> audioFiles( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual std::vector<MediaPtr> videoFiles( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual AlbumPtr album( unsigned int id ) const = 0;
virtual std::vector<AlbumPtr> albums( medialibrary::SortingCriteria sort, bool desc ) const = 0;
virtual ShowPtr show( const std::string& name ) const = 0;
virtual MoviePtr movie( const std::string& title ) const = 0;
virtual ArtistPtr artist( unsigned int id ) const = 0;
/**
* @brief artists List all artists that have at least an album.
* Artists that only appear on albums as guests won't be listed from here, but will be
......
......@@ -226,12 +226,12 @@ void MediaLibrary::setVerbosity(LogLevel v)
Log::setLogLevel( v );
}
std::vector<MediaPtr> MediaLibrary::audioFiles( medialibrary::SortingCriteria sort, bool desc )
std::vector<MediaPtr> MediaLibrary::audioFiles( medialibrary::SortingCriteria sort, bool desc ) const
{
return Media::listAll( this, IMedia::Type::AudioType, sort, desc );
}
std::vector<MediaPtr> MediaLibrary::videoFiles( medialibrary::SortingCriteria sort, bool desc )
std::vector<MediaPtr> MediaLibrary::videoFiles( medialibrary::SortingCriteria sort, bool desc ) const
{
return Media::listAll( this, IMedia::Type::VideoType, sort, desc );
}
......@@ -301,7 +301,7 @@ bool MediaLibrary::deleteLabel( LabelPtr label )
return Label::destroy( this, label->id() );
}
AlbumPtr MediaLibrary::album( unsigned int id )
AlbumPtr MediaLibrary::album( unsigned int id ) const
{
return Album::fetch( this, id );
}
......@@ -311,7 +311,7 @@ std::shared_ptr<Album> MediaLibrary::createAlbum(const std::string& title )
return Album::create( this, title );
}
std::vector<AlbumPtr> MediaLibrary::albums( medialibrary::SortingCriteria sort, bool desc )
std::vector<AlbumPtr> MediaLibrary::albums( medialibrary::SortingCriteria sort, bool desc ) const
{
return Album::listAll( this, sort, desc );
}
......@@ -321,7 +321,7 @@ std::vector<GenrePtr> MediaLibrary::genres( medialibrary::SortingCriteria sort,
return Genre::listAll( this, sort, desc );
}
ShowPtr MediaLibrary::show( const std::string& name )
ShowPtr MediaLibrary::show( const std::string& name ) const
{
static const std::string req = "SELECT * FROM " + policy::ShowTable::Name
+ " WHERE name = ?";
......@@ -333,7 +333,7 @@ std::shared_ptr<Show> MediaLibrary::createShow(const std::string& name)
return Show::create( this, name );
}
MoviePtr MediaLibrary::movie( const std::string& title )
MoviePtr MediaLibrary::movie( const std::string& title ) const
{
static const std::string req = "SELECT * FROM " + policy::MovieTable::Name
+ " WHERE title = ?";
......@@ -348,7 +348,7 @@ std::shared_ptr<Movie> MediaLibrary::createMovie( Media& media, const std::strin
return movie;
}
ArtistPtr MediaLibrary::artist(unsigned int id)
ArtistPtr MediaLibrary::artist(unsigned int id) const
{
return Artist::fetch( this, id );
}
......
......@@ -56,8 +56,8 @@ class MediaLibrary : public IMediaLibrary
virtual bool initialize( const std::string& dbPath, const std::string& thumbnailPath, IMediaLibraryCb* metadataCb ) override;
virtual void setVerbosity( LogLevel v ) override;
virtual std::vector<MediaPtr> audioFiles( medialibrary::SortingCriteria sort, bool desc) override;
virtual std::vector<MediaPtr> videoFiles( medialibrary::SortingCriteria sort, bool desc) override;
virtual std::vector<MediaPtr> audioFiles( medialibrary::SortingCriteria sort, bool desc) const override;
virtual std::vector<MediaPtr> videoFiles( medialibrary::SortingCriteria sort, bool desc) const override;
std::shared_ptr<Media> addFile( const fs::IFile& fileFs, Folder& parentFolder, fs::IDirectory& parentFolderFs );
......@@ -67,19 +67,19 @@ class MediaLibrary : public IMediaLibrary
virtual LabelPtr createLabel( const std::string& label ) override;
virtual bool deleteLabel( LabelPtr label ) override;
virtual AlbumPtr album( unsigned int id ) override;
virtual AlbumPtr album( unsigned int id ) const override;
std::shared_ptr<Album> createAlbum( const std::string& title );
virtual std::vector<AlbumPtr> albums(medialibrary::SortingCriteria sort, bool desc) override;
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 ShowPtr show( const std::string& name ) override;
virtual ShowPtr show( const std::string& name ) const override;
std::shared_ptr<Show> createShow( const std::string& name );
virtual MoviePtr movie( const std::string& title ) override;
virtual MoviePtr movie( const std::string& title ) const override;
std::shared_ptr<Movie> createMovie( Media& media, const std::string& title );
virtual ArtistPtr artist( unsigned int id ) override;
virtual ArtistPtr artist( unsigned int id ) const override;
ArtistPtr artist( const std::string& name );
std::shared_ptr<Artist> createArtist( const std::string& name );
virtual std::vector<ArtistPtr> artists( medialibrary::SortingCriteria sort, bool desc ) 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