Check for live photo against db entry instead of server entry
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 30 Oct 2024 08:01:28 +0000 (16:01 +0800)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 20 Nov 2024 13:39:51 +0000 (14:39 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/libsync/discovery.cpp

index b4e4b0434966d2e788d942930c1f75abda0a0696..05bdf1554bc0b0819eab98fbfe9dc1892f2d283d 100644 (file)
@@ -547,6 +547,7 @@ void ProcessDirectoryJob::processFile(PathTuple path,
                            << " | e2eeMangledName: " << dbEntry.e2eMangledName() << "/" << serverEntry.e2eMangledName
                            << " | file lock: " << localFileIsLocked << "//" << serverFileIsLocked
                            << " | file lock type: " << localFileLockType << "//" << serverFileLockType
+                           << " | live photo: " << dbEntry._isLivePhoto << "//" << serverEntry.isLivePhoto
                            << " | metadata missing: /" << localEntry.isMetadataMissing << '/';
 
     qCInfo(lcDisco).nospace() << processingLog;
@@ -1122,7 +1123,7 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
                 qCWarning(lcDisco) << "Failed to delete a file record from the local DB" << path._original;
             }
             return;
-        } else if (serverEntry.isLivePhoto && QMimeDatabase().mimeTypeForFile(item->_file).inherits(QStringLiteral("video/quicktime"))) {
+        } else if (dbEntry._isLivePhoto && QMimeDatabase().mimeTypeForFile(item->_file).inherits(QStringLiteral("video/quicktime"))) {
             // This is a live photo's video file; the server won't allow deletion of this file
             // so we need to *not* propagate the .mov deletion to the server and redownload the file
             qCInfo(lcDisco) << "Live photo video file deletion detected, redownloading" << item->_file;