mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(mobile): stack only through merging from timeline (#4598)
* mobile: remove stack selection page * mobile: require at-least 2 assets to stack * mobile: sort stack children by fileCreatedAt --------- Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -245,31 +245,3 @@ QueryBuilder<Asset, Asset, QAfterSortBy>? getRemoteAssetQuery(WidgetRef ref) {
|
||||
.stackParentIdIsNull()
|
||||
.sortByFileCreatedAtDesc();
|
||||
}
|
||||
|
||||
QueryBuilder<Asset, Asset, QAfterSortBy>? getAssetStackSelectionQuery(
|
||||
WidgetRef ref,
|
||||
Asset parentAsset,
|
||||
) {
|
||||
final userId = ref.watch(currentUserProvider)?.isarId;
|
||||
if (userId == null || !parentAsset.isRemote) {
|
||||
return null;
|
||||
}
|
||||
return ref
|
||||
.watch(dbProvider)
|
||||
.assets
|
||||
.where()
|
||||
.remoteIdIsNotNull()
|
||||
.filter()
|
||||
.isArchivedEqualTo(false)
|
||||
.ownerIdEqualTo(userId)
|
||||
.not()
|
||||
.remoteIdEqualTo(parentAsset.remoteId)
|
||||
// Show existing stack children in selection page
|
||||
.group(
|
||||
(q) => q
|
||||
.stackParentIdIsNull()
|
||||
.or()
|
||||
.stackParentIdEqualTo(parentAsset.remoteId),
|
||||
)
|
||||
.sortByFileCreatedAtDesc();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user