From: Claudio Cambra Date: Wed, 30 Oct 2024 03:03:02 +0000 (+0800) Subject: If the user tries to delete the movie component of a live photo, redownload this X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~32^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7f898836635fa45bd0321e4a3a1b75a3957c43ae;p=nextcloud-desktop.git If the user tries to delete the movie component of a live photo, redownload this Signed-off-by: Claudio Cambra --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 00a0a44b2..b4e4b0434 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1122,6 +1122,12 @@ 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"))) { + // 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; + item->_direction = SyncFileItem::Down; + item->_instruction = CSYNC_INSTRUCTION_SYNC; } else if (!serverModified) { // Removed locally: also remove on the server. if (!dbEntry._serverHasIgnoredFiles) {