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

IMediaLibrary: Publicly expose folder( int64_t )

parent 4f019264
Pipeline #1557 passed with stages
in 11 minutes and 51 seconds
......@@ -419,6 +419,7 @@ class IMediaLibrary
virtual Query<IFolder> folders( const QueryParameters* params = nullptr ) const = 0;
virtual Query<IFolder> searchFolders( const std::string& pattern,
const QueryParameters* params ) const = 0;
virtual FolderPtr folder( int64_t folderId ) const = 0;
virtual FolderPtr folder( const std::string& mrl ) const = 0;
virtual void removeEntryPoint( const std::string& entryPoint ) = 0;
/**
......
......@@ -1404,6 +1404,11 @@ Query<IFolder> MediaLibrary::searchFolders( const std::string& pattern,
return Folder::searchWithMedia( this, pattern, params );
}
FolderPtr MediaLibrary::folder( int64_t id ) const
{
return Folder::fetch( this, id );
}
FolderPtr MediaLibrary::folder( const std::string& mrl ) const
{
return Folder::fromMrl( this, mrl, Folder::BannedType::Any );
......
......@@ -147,6 +147,7 @@ class MediaLibrary : public IMediaLibrary, public IDeviceListerCb
virtual Query<IFolder> folders( const QueryParameters* params = nullptr ) const override;
virtual Query<IFolder> searchFolders( const std::string& pattern,
const QueryParameters* params ) const override;
virtual FolderPtr folder( int64_t id ) const override;
virtual FolderPtr folder( const std::string& mrl ) const override;
virtual void removeEntryPoint( const std::string& entryPoint ) override;
virtual void banFolder( const std::string& path ) override;
......
......@@ -54,9 +54,9 @@ FolderPtr MediaLibraryTester::folder( const std::string& mrl ) const
return Folder::fromMrl( this, mrl, Folder::BannedType::No );
}
FolderPtr MediaLibraryTester::folder(int64_t id) const
FolderPtr MediaLibraryTester::folder( int64_t id ) const
{
return Folder::fetch( this, id );
return MediaLibrary::folder( id );
}
std::shared_ptr<Media> MediaLibraryTester::addFile( const std::string& path, IMedia::Type type )
......
......@@ -47,7 +47,7 @@ public:
// And override the ID getter to return a Media instead of IMedia
std::shared_ptr<Media> media( int64_t id );
FolderPtr folder( const std::string& path ) const override;
FolderPtr folder( int64_t id ) const;
virtual FolderPtr folder( int64_t id ) const override;
void deleteAlbum( int64_t albumId );
std::shared_ptr<Album> createAlbum( const std::string& title );
std::shared_ptr<Genre> createGenre( 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