feat(web): bulk deduplicate (#10448)

* bulk deduplicate

* notification for keeping all duplicates

* fix notification

* remove unused text

* pr feedback

* wording

* formatting
This commit is contained in:
Mert
2024-06-19 12:11:59 -04:00
committed by GitHub
parent 86cbc6e125
commit b3f9641edf
4 changed files with 123 additions and 24 deletions

View File

@@ -15,9 +15,11 @@ import {
linkOAuthAccount,
startOAuth,
unlinkOAuthAccount,
type AssetResponseDto,
type SharedLinkResponseDto,
} from '@immich/sdk';
import { mdiCogRefreshOutline, mdiDatabaseRefreshOutline, mdiImageRefreshOutline } from '@mdi/js';
import { sortBy } from 'lodash-es';
import { t } from 'svelte-i18n';
import { derived, get } from 'svelte/store';
@@ -310,3 +312,7 @@ export const withError = async <T>(fn: () => Promise<T>): Promise<[undefined, T]
return [error, undefined];
}
};
export const suggestDuplicateByFileSize = (assets: AssetResponseDto[]): AssetResponseDto | undefined => {
return sortBy(assets, (asset) => asset.exifInfo?.fileSizeInByte).pop();
};