mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
group local assets by checksum before moving to trash
delete LocalAssetEntity records when moved to trash refactor code
This commit is contained in:
parent
c7e4f9db85
commit
d8fb41e795
2 changed files with 16 additions and 8 deletions
|
|
@ -44,7 +44,7 @@ class DriftLocalAssetRepository extends DriftDatabaseRepository {
|
|||
});
|
||||
}
|
||||
|
||||
Future<void> delete(List<String> ids) {
|
||||
Future<void> delete(Iterable<String> ids) {
|
||||
if (ids.isEmpty) {
|
||||
return Future.value();
|
||||
}
|
||||
|
|
@ -71,8 +71,11 @@ class DriftLocalAssetRepository extends DriftDatabaseRepository {
|
|||
}
|
||||
|
||||
Future<List<LocalAsset>> getByChecksums(Iterable<String> checksums) {
|
||||
if (checksums.isEmpty) return Future.value([]);
|
||||
final query = _db.localAssetEntity.select()..where((lae) => lae.checksum.isIn(checksums));
|
||||
if (checksums.isEmpty) {
|
||||
return Future.value([]);
|
||||
}
|
||||
final query = _db.localAssetEntity.select()
|
||||
..where((lae) => lae.checksum.isIn(checksums));
|
||||
return query.map((row) => row.toDto()).get();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue