You've already forked immich
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:
@ -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(
|
||||
|
Reference in New Issue
Block a user