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

MediaLibrary: Move all blacklisting code to the Folder class

parent 176dae5a
......@@ -112,6 +112,12 @@ std::shared_ptr<Folder> Folder::create( DBConnection connection, const std::stri
bool Folder::blacklist( DBConnection connection, const std::string& fullPath )
{
auto f = fromPath( connection, fullPath );
if ( f != nullptr )
{
// Let the foreign key destroy everything beneath this folder
destroy( connection, f->id() );
}
auto folderFs = FsFactory->createDirectory( fullPath );
if ( folderFs == nullptr )
return false;
......
......@@ -397,12 +397,6 @@ void MediaLibrary::discover( const std::string &entryPoint )
bool MediaLibrary::ignoreFolder( const std::string& path )
{
auto f = Folder::fromPath( m_dbConnection.get(), path );
if ( f != nullptr )
{
// Let the foreign key destroy everything beneath this folder
Folder::destroy( m_dbConnection.get(), f->id() );
}
return Folder::blacklist( m_dbConnection.get(), 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