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

Medialibrary: Move files() methods to testing code

parent 506a620d
......@@ -226,12 +226,6 @@ void MediaLibrary::setVerbosity(LogLevel v)
Log::setLogLevel( v );
}
std::vector<MediaPtr> MediaLibrary::files()
{
static const std::string req = "SELECT * FROM " + policy::MediaTable::Name + " WHERE is_present = 1";
return Media::fetchAll<IMedia>( this, req );
}
std::vector<MediaPtr> MediaLibrary::audioFiles()
{
static const std::string req = "SELECT * FROM " + policy::MediaTable::Name + " WHERE type = ? AND is_present = 1 ORDER BY title";
......
......@@ -56,7 +56,6 @@ class MediaLibrary : public IMediaLibrary
virtual bool initialize( const std::string& dbPath, const std::string& thumbnailPath, IMediaLibraryCb* metadataCb ) override;
virtual void setVerbosity( LogLevel v ) override;
std::vector<MediaPtr> files();
virtual std::vector<MediaPtr> audioFiles() override;
virtual std::vector<MediaPtr> videoFiles() override;
std::shared_ptr<Media> addFile( const fs::IFile& fileFs, Folder& parentFolder, fs::IDirectory& parentFolderFs );
......
......@@ -122,3 +122,9 @@ std::shared_ptr<AlbumTrack> MediaLibraryTester::albumTrack( unsigned int id )
{
return AlbumTrack::fetch( this, id );
}
std::vector<MediaPtr> MediaLibraryTester::files()
{
static const std::string req = "SELECT * FROM " + policy::MediaTable::Name + " WHERE is_present = 1";
return Media::fetchAll<IMedia>( this, req );
}
......@@ -32,6 +32,7 @@ class MediaLibraryTester : public MediaLibrary
{
public:
MediaLibraryTester();
std::vector<MediaPtr> files();
std::shared_ptr<Media> media( unsigned int id );
MediaPtr media( const std::string& path );
std::shared_ptr<Folder> folder( const std::string& path );
......
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