1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

refactor(mobile): asset provider (#16159)

* refactor(mobile): asset provider

* wip

* wip: delete local assets

* wip: delete remote assets

* wip: deletion logic

* refactor

* pr feedback
This commit is contained in:
Alex
2025-02-18 13:10:55 -06:00
committed by GitHub
parent 70d08a2b2a
commit 9d4aee36e2
24 changed files with 326 additions and 299 deletions

View File

@ -57,7 +57,7 @@ class AssetRepository extends DatabaseRepository implements IAssetRepository {
}
@override
Future<void> deleteById(List<int> ids) => txn(() async {
Future<void> deleteByIds(List<int> ids) => txn(() async {
await db.assets.deleteAll(ids);
await db.exifInfos.deleteAll(ids);
});
@ -210,6 +210,18 @@ class AssetRepository extends DatabaseRepository implements IAssetRepository {
.thenByFileCreatedAtDesc()
.findAll();
}
@override
Future<void> clearTable() async {
await txn(() async {
await db.assets.clear();
});
}
@override
Stream<Asset?> watchAsset(int id, {bool fireImmediately = false}) {
return db.assets.watchObject(id, fireImmediately: fireImmediately);
}
}
Future<List<Asset>> _getMatchesImpl(