mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: show un-hashed remainder assets (#22492)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
f1f8c8e7a3
commit
8f1bc7e821
2 changed files with 6 additions and 3 deletions
|
|
@ -81,7 +81,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<LocalAsset>> getCandidates(String userId) async {
|
Future<List<LocalAsset>> getCandidates(String userId, {bool onlyHashed = true}) async {
|
||||||
final selectedAlbumIds = _db.localAlbumEntity.selectOnly(distinct: true)
|
final selectedAlbumIds = _db.localAlbumEntity.selectOnly(distinct: true)
|
||||||
..addColumns([_db.localAlbumEntity.id])
|
..addColumns([_db.localAlbumEntity.id])
|
||||||
..where(_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected));
|
..where(_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected));
|
||||||
|
|
@ -89,7 +89,6 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||||
final query = _db.localAssetEntity.select()
|
final query = _db.localAssetEntity.select()
|
||||||
..where(
|
..where(
|
||||||
(lae) =>
|
(lae) =>
|
||||||
lae.checksum.isNotNull() &
|
|
||||||
existsQuery(
|
existsQuery(
|
||||||
_db.localAlbumAssetEntity.selectOnly()
|
_db.localAlbumAssetEntity.selectOnly()
|
||||||
..addColumns([_db.localAlbumAssetEntity.assetId])
|
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||||
|
|
@ -109,6 +108,10 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||||
)
|
)
|
||||||
..orderBy([(localAsset) => OrderingTerm.desc(localAsset.createdAt)]);
|
..orderBy([(localAsset) => OrderingTerm.desc(localAsset.createdAt)]);
|
||||||
|
|
||||||
|
if (onlyHashed) {
|
||||||
|
query.where((lae) => lae.checksum.isNotNull());
|
||||||
|
}
|
||||||
|
|
||||||
return query.map((localAsset) => localAsset.toDto()).get();
|
return query.map((localAsset) => localAsset.toDto()).get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ final driftBackupCandidateProvider = FutureProvider.autoDispose<List<LocalAsset>
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ref.read(backupRepositoryProvider).getCandidates(user.id);
|
return ref.read(backupRepositoryProvider).getCandidates(user.id, onlyHashed: false);
|
||||||
});
|
});
|
||||||
|
|
||||||
final driftCandidateBackupAlbumInfoProvider = FutureProvider.autoDispose.family<List<LocalAlbum>, String>((
|
final driftCandidateBackupAlbumInfoProvider = FutureProvider.autoDispose.family<List<LocalAlbum>, String>((
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue