fix: remainder backup count (#20270)

This commit is contained in:
Alex 2025-07-26 09:02:26 -05:00 committed by GitHub
parent 9bbad45990
commit 07cb2fb04e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,13 +63,14 @@ class DriftBackupRepository extends DriftDatabaseRepository {
),
leftOuterJoin(
_db.remoteAssetEntity,
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum) &
_db.remoteAssetEntity.ownerId.equals(userId),
useColumns: false,
),
])
..where(
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected) &
(_db.remoteAssetEntity.id.isNull() | _db.remoteAssetEntity.ownerId.equals(userId).not()) &
_db.remoteAssetEntity.id.isNull() &
_db.localAlbumAssetEntity.assetId.isNotInQuery(_getExcludedSubquery()),
);