If the user tries to delete the movie component of a live photo, redownload this

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-10-30 11:03:02 +08:00 коммит произвёл Matthieu Gallien
Родитель e20bedac1f
Коммит 7f89883663
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -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) {