Commit 5ccff338 by Hugo Beauzée-Luyssen

MediaLibrary: Publicly expose a way to fetch a known folder

parent 31878917
......@@ -313,6 +313,7 @@ class IMediaLibrary
virtual void discover( const std::string& entryPoint ) = 0;
virtual void setDiscoverNetworkEnabled( bool enable ) = 0;
virtual std::vector<FolderPtr> entryPoints() const = 0;
virtual FolderPtr folder( const std::string& mrl ) const = 0;
virtual void removeEntryPoint( const std::string& entryPoint ) = 0;
/**
* @brief banFolder will prevent an entry point folder from being discovered.
......
......@@ -79,7 +79,6 @@ public:
virtual bool isBanned() const override;
bool isRootFolder() const;
private:
enum class BannedType
{
Yes, //< Only select banned folders
......
......@@ -1039,6 +1039,11 @@ std::vector<FolderPtr> MediaLibrary::entryPoints() const
return Folder::fetchAll<IFolder>( this, req );
}
FolderPtr MediaLibrary::folder( const std::string& mrl ) const
{
return Folder::fromMrl( this, mrl, Folder::BannedType::Any );
}
void MediaLibrary::removeEntryPoint( const std::string& entryPoint )
{
if ( m_discovererWorker != nullptr )
......
......@@ -124,6 +124,7 @@ class MediaLibrary : public IMediaLibrary, public IDeviceListerCb
virtual void discover( const std::string& entryPoint ) override;
virtual void setDiscoverNetworkEnabled( bool enabled ) override;
virtual std::vector<FolderPtr> entryPoints() 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;
virtual void unbanFolder( const std::string& path ) 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