Commit 78a40ef2 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Hugo Beauzée-Luyssen

FsDiscoverer: Fix invalid folder comparison

In case the devices containing the folder have multiple mountpoints,
using the MRL might lead to false negative.
Should fix #125
parent a135f05a
Pipeline #9424 passed with stage
in 32 minutes and 30 seconds
......@@ -40,6 +40,7 @@
#include "MediaLibrary.h"
#include "probe/CrawlerProbe.h"
#include "utils/Filename.h"
#include "utils/Url.h"
namespace medialibrary
{
......@@ -282,7 +283,8 @@ void FsDiscoverer::checkFolder( std::shared_ptr<fs::IDirectory> currentFolderFs,
continue;
auto it = std::find_if( begin( subFoldersInDB ), end( subFoldersInDB ),
[&subFolder](const std::shared_ptr<Folder>& f) {
return f->mrl() == subFolder->mrl();
auto subFolderName = utils::file::directoryName( subFolder->mrl() );
return f->name() == utils::url::decode( subFolderName );
});
// We don't know this folder, it's a new one
if ( it == end( subFoldersInDB ) )
......
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