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

FsDiscoverer: Invoke onDiscoveryStarted each time we enter a sub entrypoint

parent 6e65070c
......@@ -510,7 +510,7 @@ void MediaLibrary::startParser()
void MediaLibrary::startDiscoverer()
{
m_discoverer.reset( new DiscovererWorker( this ) );
m_discoverer->addDiscoverer( std::unique_ptr<IDiscoverer>( new FsDiscoverer( m_fsFactory, this ) ) );
m_discoverer->addDiscoverer( std::unique_ptr<IDiscoverer>( new FsDiscoverer( m_fsFactory, this, m_callback ) ) );
m_discoverer->reload();
}
......
......@@ -38,9 +38,10 @@
namespace medialibrary
{
FsDiscoverer::FsDiscoverer( std::shared_ptr<factory::IFileSystem> fsFactory, MediaLibrary* ml )
FsDiscoverer::FsDiscoverer( std::shared_ptr<factory::IFileSystem> fsFactory, MediaLibrary* ml, IMediaLibraryCb* cb )
: m_ml( ml )
, m_fsFactory( fsFactory )
, m_cb( cb )
{
}
......@@ -138,6 +139,7 @@ void FsDiscoverer::checkFolder( fs::IDirectory& currentFolderFs, Folder& current
m_ml->deleteFolder( currentFolder );
return;
}
m_cb->onDiscoveryStarted( currentFolderFs.path() );
// Load the folders we already know of:
LOG_INFO( "Checking for modifications in ", currentFolderFs.path() );
auto subFoldersInDB = Folder::fetchAll( m_ml, currentFolder.id() );
......
......@@ -37,7 +37,7 @@ class Folder;
class FsDiscoverer : public IDiscoverer
{
public:
FsDiscoverer( std::shared_ptr<factory::IFileSystem> fsFactory, MediaLibrary* ml );
FsDiscoverer( std::shared_ptr<factory::IFileSystem> fsFactory, MediaLibrary* ml , IMediaLibraryCb* cb );
virtual bool discover(const std::string &entryPoint ) override;
virtual void reload() override;
virtual void reload( const std::string& entryPoint ) override;
......@@ -58,6 +58,7 @@ private:
private:
MediaLibrary* m_ml;
std::shared_ptr<factory::IFileSystem> m_fsFactory;
IMediaLibraryCb* m_cb;
};
}
......
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