feat(mobile): use efficient sync (#8842)

* feat(mobile): use efficient sync

review feedback

* adapt to changed  server endpoints

* formatting

* fix memory lane bug

* fix: bad merge

* fix call not returning correct number of asset

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Fynn Petersen-Frey 2024-05-14 17:35:37 +02:00 committed by GitHub
parent acc611a3d9
commit 116043b2b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 185 additions and 125 deletions

View file

@ -37,12 +37,16 @@ class MemoryService {
List<Memory> memories = [];
for (final MemoryLaneResponseDto(:title, :assets) in data) {
memories.add(
Memory(
title: title,
assets: await _db.assets.getAllByRemoteId(assets.map((e) => e.id)),
),
);
final dbAssets =
await _db.assets.getAllByRemoteId(assets.map((e) => e.id));
if (dbAssets.isNotEmpty) {
memories.add(
Memory(
title: title,
assets: dbAssets,
),
);
}
}
return memories.isNotEmpty ? memories : null;