Commit 71391686 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

IMediaLibraryCb: Add onEntryPointAdded

fix #86
parent bb5f72b2
Pipeline #7363 passed with stage
in 14 minutes and 11 seconds
......@@ -166,6 +166,20 @@ public:
* entry point that has been reloaded
*/
virtual void onReloadCompleted( const std::string& entryPoint, bool success ) = 0;
/**
* @brief onEntryPointAdded will be invoked when an entrypoint gets added
* @param entryPoint The entry point which was scheduled for discovery
*
* This callback will only be emitted the first time the entry point gets
* processed, after it has been inserted to the database.
* Later processing of that entry point will still cause \sa{onDiscoveryStarted}
* \sa{onDiscoveryProgress} and \sa{onDiscoveryCompleted} events to be fired
* \warning This event will be fired after \sa{onDiscoveryStarted} since we
* don't know if an entry point is known before starting it's processing
*/
virtual void onEntryPointAdded( const std::string& entryPoint ) = 0;
/**
* @brief onEntryPointRemoved will be invoked when an entrypoint removal request gets processsed
* by the appropriate worker thread.
......
......@@ -72,6 +72,7 @@ bool FsDiscoverer::discover( const std::string& entryPoint )
// If the folder exists, we assume it will be handled by reload()
if ( f != nullptr )
return true;
m_ml->getCb()->onEntryPointAdded( entryPoint );
try
{
if ( m_probe->proceedOnDirectory( *fsDir ) == false || m_probe->isHidden( *fsDir ) == true )
......
......@@ -52,6 +52,7 @@ class NoopCallback : public IMediaLibraryCb
virtual void onGenresDeleted( std::vector<int64_t> ) override {}
virtual void onReloadStarted( const std::string& ) override {}
virtual void onReloadCompleted( const std::string&, bool ) override {}
virtual void onEntryPointAdded( const std::string& ) override {}
virtual void onEntryPointRemoved( const std::string&, bool ) override {}
virtual void onEntryPointBanned( const std::string&, bool ) override {}
virtual void onEntryPointUnbanned( const std::string&, bool ) override {}
......
Supports Markdown
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