From e20bedac1fe2518e4389ae80a11ba84694fc24df Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 29 Oct 2024 12:06:57 +0800 Subject: [PATCH] Set live photo properties on syncfileitem when creating one based on other types of items Signed-off-by: Claudio Cambra --- src/libsync/syncfileitem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libsync/syncfileitem.cpp b/src/libsync/syncfileitem.cpp index 8b195d647..2746b192c 100644 --- a/src/libsync/syncfileitem.cpp +++ b/src/libsync/syncfileitem.cpp @@ -126,6 +126,8 @@ SyncJournalFileRecord SyncFileItem::toSyncJournalFileRecordWithInode(const QStri rec._lockstate._lockTime = _lockTime; rec._lockstate._lockTimeout = _lockTimeout; rec._lockstate._lockToken = _lockToken; + rec._isLivePhoto = _isLivePhoto; + rec._livePhotoFile = _livePhotoFile; // Update the inode if possible rec._inode = _inode; @@ -167,6 +169,8 @@ SyncFileItemPtr SyncFileItem::fromSyncJournalFileRecord(const SyncJournalFileRec item->_sharedByMe = rec._sharedByMe; item->_isShared = rec._isShared; item->_lastShareStateFetchedTimestamp = rec._lastShareStateFetchedTimestamp; + item->_isLivePhoto = rec._isLivePhoto; + item->_livePhotoFile = rec._livePhotoFile; return item; } @@ -237,6 +241,11 @@ SyncFileItemPtr SyncFileItem::fromProperties(const QString &filePath, const QMap item->_checksumHeader = findBestChecksum(properties.value("checksums").toUtf8()); } + if (properties.contains(QStringLiteral("metadata-files-live-photo"))) { + item->_isLivePhoto = true; + item->_livePhotoFile = properties.value(QStringLiteral("metadata-files-live-photo")); + } + // direction and instruction are decided later item->_direction = SyncFileItem::None; item->_instruction = CSYNC_INSTRUCTION_NONE;