fix: json encoding failure during live photo download (#20444)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-07-30 23:18:18 +05:30 committed by GitHub
parent c278b7ad17
commit f85d8add01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@ class DownloadRepository {
group: '',
updates: Updates.statusAndProgress,
);
static final _dummyMetadata = {'part': LivePhotosPart.image, 'id': ''};
static final _dummyMetadata = {'part': LivePhotosPart.image.index, 'id': ''};
void Function(TaskStatusUpdate)? onImageDownloadStatus;
@ -102,7 +102,7 @@ class DownloadRepository {
continue;
}
_dummyMetadata['part'] = LivePhotosPart.image;
_dummyMetadata['part'] = LivePhotosPart.image.index;
_dummyMetadata['id'] = id;
tasks[taskIndex++] = DownloadTask(
taskId: id,
@ -114,7 +114,7 @@ class DownloadRepository {
metaData: json.encode(_dummyMetadata),
);
_dummyMetadata['part'] = LivePhotosPart.video;
_dummyMetadata['part'] = LivePhotosPart.video.index;
tasks[taskIndex++] = DownloadTask(
taskId: livePhotoVideoId,
url: url,