mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(mobile): efficient asset sync (#3945)
* feat(mobile): efficient asset sync
This commit is contained in:
committed by
GitHub
parent
4b11e925d9
commit
5d1011b482
@@ -417,17 +417,17 @@ enum AssetState {
|
||||
|
||||
extension AssetsHelper on IsarCollection<Asset> {
|
||||
Future<int> deleteAllByRemoteId(Iterable<String> ids) =>
|
||||
ids.isEmpty ? Future.value(0) : _remote(ids).deleteAll();
|
||||
ids.isEmpty ? Future.value(0) : remote(ids).deleteAll();
|
||||
Future<int> deleteAllByLocalId(Iterable<String> ids) =>
|
||||
ids.isEmpty ? Future.value(0) : _local(ids).deleteAll();
|
||||
ids.isEmpty ? Future.value(0) : local(ids).deleteAll();
|
||||
Future<List<Asset>> getAllByRemoteId(Iterable<String> ids) =>
|
||||
ids.isEmpty ? Future.value([]) : _remote(ids).findAll();
|
||||
ids.isEmpty ? Future.value([]) : remote(ids).findAll();
|
||||
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) =>
|
||||
ids.isEmpty ? Future.value([]) : _local(ids).findAll();
|
||||
ids.isEmpty ? Future.value([]) : local(ids).findAll();
|
||||
|
||||
QueryBuilder<Asset, Asset, QAfterWhereClause> _remote(Iterable<String> ids) =>
|
||||
QueryBuilder<Asset, Asset, QAfterWhereClause> remote(Iterable<String> ids) =>
|
||||
where().anyOf(ids, (q, String e) => q.remoteIdEqualTo(e));
|
||||
QueryBuilder<Asset, Asset, QAfterWhereClause> _local(Iterable<String> ids) {
|
||||
QueryBuilder<Asset, Asset, QAfterWhereClause> local(Iterable<String> ids) {
|
||||
return where().anyOf(ids, (q, String e) => q.localIdEqualTo(e));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user