Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix stale localID null in gallery download queue service

ashilkn7b6f2c3bb44a
diff --git a/mobile/apps/photos/lib/module/download/gallery_download_queue_service.dart b/mobile/apps/photos/lib/module/download/gallery_download_queue_service.dart
index 6633ea851c..de697a0a78 100644
--- a/mobile/apps/photos/lib/module/download/gallery_download_queue_service.dart
+++ b/mobile/apps/photos/lib/module/download/gallery_download_queue_service.dart
@@ -183,8 +183,9 @@ class GalleryDownloadQueueService {
if (uploadID == null || fileSize == null || fileSize <= 0) {
continue;
}
- final queuedFile =
- file.isRemoteFile ? file.copyWith() : file.copyWith(localID: null);
+ final queuedFile = file.isRemoteFile
+ ? file.copyWith()
+ : (file.copyWith()..localID = null);
_queuedFilesByID[uploadID] = queuedFile;
final sourceFileJson = _serializeQueuedFile(queuedFile);
if (_tasks.containsKey(uploadID)) {
@@ -473,7 +474,7 @@ class GalleryDownloadQueueService {
}
file.fileSize ??= _tasks[fileID]?.totalBytes;
final fileToDownload =
- file.isRemoteFile ? file.copyWith() : file.copyWith(localID: null);
+ file.isRemoteFile ? file.copyWith() : (file.copyWith()..localID = null);
await downloadToGallery(
fileToDownload,
forceResumableDownload: true,