From c72c82c40184d48a0c3453134f76a6d3edf03bd9 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Thu, 27 Mar 2025 19:17:05 +0530 Subject: [PATCH] fix(mobile): faster device album refresh after initial sync (#17170) fix(mobile): faster device album refresh after fresh sync Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/services/sync.service.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mobile/lib/services/sync.service.dart b/mobile/lib/services/sync.service.dart index 0f1f8d79e6..a05d4b648e 100644 --- a/mobile/lib/services/sync.service.dart +++ b/mobile/lib/services/sync.service.dart @@ -737,6 +737,11 @@ class SyncService { album.thumbnail.value = thumb; try { await _albumRepository.create(album); + final int assetCount = + await _albumMediaRepository.getAssetCount(album.localId!); + await _eTagRepository.upsertAll([ + ETag(id: album.eTagKeyAssetCount, assetCount: assetCount), + ]); _log.info("Added a new local album to DB: ${album.name}"); } catch (e) { _log.severe("Failed to add new local album ${album.name} to DB", e);