mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
feat(web): Add stacking option to deduplication utilities (#11114)
* feat(web): Add stacking option to deduplication utilities * Update web/src/lib/components/utilities-page/duplicates/duplicates-compare-control.svelte Co-authored-by: Alex <alex.tran1502@gmail.com> * Fix prettier * Draft for server side modifications. Endpoint for stacks (PUT,DELETE) * Fix error * Disable stakc button if less or more than one asset selected * Remove unnecesarry log * Revert to first commit * Further Revert * Actually Revert to Origin * Only one stack button * Update +page.svelte * Fix optional arguments * Fix Prettier * Fix Linting * Add stack information to asset view * clean up --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
9f4fad2a0f
commit
65f5118bdd
5 changed files with 82 additions and 30 deletions
web/src/lib/utils
|
@ -324,7 +324,7 @@ export const getSelectedAssets = (assets: Set<AssetResponseDto>, user: UserRespo
|
|||
return ids;
|
||||
};
|
||||
|
||||
export const stackAssets = async (assets: AssetResponseDto[]) => {
|
||||
export const stackAssets = async (assets: AssetResponseDto[], showNotification = true) => {
|
||||
if (assets.length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
@ -362,16 +362,18 @@ export const stackAssets = async (assets: AssetResponseDto[]) => {
|
|||
parent.stack = parent.stack.concat(children, grandChildren);
|
||||
parent.stackCount = parent.stack.length + 1;
|
||||
|
||||
notificationController.show({
|
||||
message: $t('stacked_assets_count', { values: { count: parent.stackCount } }),
|
||||
type: NotificationType.Info,
|
||||
button: {
|
||||
text: $t('view_stack'),
|
||||
onClick() {
|
||||
return assetViewingStore.setAssetId(parent.id);
|
||||
if (showNotification) {
|
||||
notificationController.show({
|
||||
message: $t('stacked_assets_count', { values: { count: parent.stackCount } }),
|
||||
type: NotificationType.Info,
|
||||
button: {
|
||||
text: $t('view_stack'),
|
||||
onClick() {
|
||||
return assetViewingStore.setAssetId(parent.id);
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return ids;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue