Commit 8de4c09f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Task: Fix potential issues with fs file restoration

refs #92
parent 7661a1de
Pipeline #6993 failed with stages
in 27 minutes and 41 seconds
......@@ -409,8 +409,11 @@ bool Task::restoreLinkedEntities()
try
{
auto files = parentFolderFs->files();
auto it = std::find_if( begin( files ), end( files ), [&mrl]( std::shared_ptr<fs::IFile> f ) {
return f->mrl() == mrl;
// Don't compare entire mrls, this might yield false negative when a
// device has multiple mountpoints.
auto fileName = utils::file::fileName( mrl );
auto it = std::find_if( begin( files ), end( files ), [&fileName]( std::shared_ptr<fs::IFile> f ) {
return f->name() == fileName;
});
if ( it == end( files ) )
{
......
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