Commit 09dbf434 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MetadataParser: Don't update files' modification date too early

Wait until the refresh query is processed, otherwise we could lose some
changes

(cherry picked from commit 23ca4fe1)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent cab96be1
......@@ -102,6 +102,11 @@ Status MetadataAnalyzer::run( IItem& item )
std::tie( success, needRescan ) = refreshFile( item );
if ( success == false )
return Status::Fatal;
auto file = std::static_pointer_cast<File>( item.file() );
// Now that the refresh request was processed, we can update the last
// modification date in database
file->updateFsInfo( item.fileFs()->lastModificationDate(),
item.fileFs()->size() );
if ( needRescan == false )
return Status::Success;
}
......@@ -502,9 +507,7 @@ std::tuple<bool, bool> MetadataAnalyzer::refreshFile( IItem& item ) const
assert( item.media() == nullptr );
assert( item.file() != nullptr );
auto file = std::static_pointer_cast<File>( item.file() );
file->updateFsInfo( item.fileFs()->lastModificationDate(), item.fileFs()->size() );
auto file = item.file();
switch ( file->type() )
{
......
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