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

MediaLibrary: Check file extensions from the FsDiscover

parent 65806637
......@@ -405,12 +405,6 @@ std::shared_ptr<Media> MediaLibrary::addFile( std::shared_ptr<fs::IFile> fileFs,
std::shared_ptr<Folder> parentFolder,
std::shared_ptr<fs::IDirectory> parentFolderFs )
{
if ( isExtensionSupported( fileFs->extension().c_str() ) == false )
{
LOG_INFO( "Rejecting file ", fileFs->mrl(), " due to its extension" );
return nullptr;
}
LOG_INFO( "Adding ", fileFs->mrl() );
auto mptr = Media::create( this, IMedia::Type::Unknown, fileFs->name() );
if ( mptr == nullptr )
......
......@@ -266,7 +266,8 @@ void FsDiscoverer::checkFiles( std::shared_ptr<fs::IDirectory> parentFolderFs,
});
if ( it == end( files ) )
{
filesToAdd.push_back( fileFs );
if ( MediaLibrary::isExtensionSupported( fileFs->extension().c_str() ) == true )
filesToAdd.push_back( fileFs );
continue;
}
if ( fileFs->lastModificationDate() == (*it)->lastModificationDate() )
......
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