feat(mobile): load search result assets from local DB (#5971)

This commit is contained in:
Fynn Petersen-Frey 2023-12-26 22:41:51 +01:00 committed by GitHub
parent c0ebc943d2
commit 733fa28aa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 29 deletions

View file

@ -472,6 +472,8 @@ extension AssetsHelper on IsarCollection<Asset> {
ids.isEmpty ? Future.value([]) : remote(ids).findAll();
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) =>
ids.isEmpty ? Future.value([]) : local(ids).findAll();
Future<Asset?> getByRemoteId(String id) =>
where().remoteIdEqualTo(id).findFirst();
QueryBuilder<Asset, Asset, QAfterWhereClause> remote(Iterable<String> ids) =>
where().anyOf(ids, (q, String e) => q.remoteIdEqualTo(e));