Commit 9cc58c41 authored by luyikei's avatar luyikei

Library: Fix not adding unchanged files to the model

parent 41d8f449
......@@ -320,6 +320,16 @@ Library::onDiscoveryCompleted( const std::string& entryPoint )
m_videoModel->refresh();
m_audioModel->refresh();
}
// FIXME: Optimization Needed
for ( auto media : m_ml->videoFiles() )
if ( m_videoModel->findMedia( media->id() ) == nullptr )
m_videoModel->addMedia( media );
for ( auto media : m_ml->audioFiles() )
if ( m_audioModel->findMedia( media->id() ) == nullptr )
m_audioModel->addMedia( media );
emit discoveryCompleted( QString::fromStdString( entryPoint ) );
}
......
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