feat: new upload (cont) (#20029)
* new upload button * wip * pr feedback * fix: updateAll override album selection value * feat: status box * feat: handle upload resume * re-enable websocket event * fix: update state condition and upload status * Better backup detail page --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -52,9 +52,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||
|
||||
Future<int> getRemainderCount() async {
|
||||
final query = _db.localAlbumAssetEntity.selectOnly(distinct: true)
|
||||
..addColumns(
|
||||
[_db.localAlbumAssetEntity.assetId],
|
||||
)
|
||||
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||
..join([
|
||||
innerJoin(
|
||||
_db.localAlbumEntity,
|
||||
@@ -147,6 +145,11 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||
),
|
||||
) &
|
||||
lae.id.isNotInQuery(_getExcludedSubquery()),
|
||||
)
|
||||
..orderBy(
|
||||
[
|
||||
(localAsset) => OrderingTerm.desc(localAsset.createdAt),
|
||||
],
|
||||
);
|
||||
|
||||
return query.map((localAsset) => localAsset.toDto()).get();
|
||||
|
||||
@@ -8,7 +8,13 @@ import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||
import 'package:immich_mobile/utils/database.utils.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
|
||||
enum SortLocalAlbumsBy { id, backupSelection, isIosSharedAlbum }
|
||||
enum SortLocalAlbumsBy {
|
||||
id,
|
||||
backupSelection,
|
||||
isIosSharedAlbum,
|
||||
name,
|
||||
assetCount
|
||||
}
|
||||
|
||||
class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||
final Drift _db;
|
||||
@@ -41,6 +47,9 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||
OrderingTerm.asc(_db.localAlbumEntity.backupSelection),
|
||||
SortLocalAlbumsBy.isIosSharedAlbum =>
|
||||
OrderingTerm.asc(_db.localAlbumEntity.isIosSharedAlbum),
|
||||
SortLocalAlbumsBy.name =>
|
||||
OrderingTerm.asc(_db.localAlbumEntity.name),
|
||||
SortLocalAlbumsBy.assetCount => OrderingTerm.desc(assetCount),
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -151,7 +160,15 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||
batch.insert(
|
||||
_db.localAlbumEntity,
|
||||
companion,
|
||||
onConflict: DoUpdate((_) => companion),
|
||||
onConflict: DoUpdate(
|
||||
(old) => LocalAlbumEntityCompanion(
|
||||
id: companion.id,
|
||||
name: companion.name,
|
||||
updatedAt: companion.updatedAt,
|
||||
isIosSharedAlbum: companion.isIosSharedAlbum,
|
||||
marker_: companion.marker_,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user