Skip to content

High performance self-hosted photo and video management solution.

chore(web): remove dead code (#29092)

Mees Frensel5f1a180d1af7
diff --git a/web/src/lib/elements/SearchBar.svelte b/web/src/lib/elements/SearchBar.svelte
index 4e8f49755e..c20eda2928 100644
--- a/web/src/lib/elements/SearchBar.svelte
+++ b/web/src/lib/elements/SearchBar.svelte
@@ -1,5 +1,4 @@
<script lang="ts">
- import type { SearchOptions } from '$lib/utils/dipatch';
import { IconButton, LoadingSpinner } from '@immich/ui';
import { mdiClose, mdiMagnify } from '@mdi/js';
import { t } from 'svelte-i18n';
@@ -9,7 +8,7 @@
roundedBottom?: boolean;
showLoadingSpinner: boolean;
placeholder: string;
- onSearch?: (options: SearchOptions) => void;
+ onSearch?: (options: { force?: boolean }) => void;
onReset?: () => void;
}
diff --git a/web/src/lib/utils/dipatch.ts b/web/src/lib/utils/dipatch.ts
deleted file mode 100644
index b1c105f1d1..0000000000
--- a/web/src/lib/utils/dipatch.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export interface ResetOptions {
- default?: boolean;
-}
-
-export interface SearchOptions {
- force?: boolean;
-}
diff --git a/web/src/lib/utils/exif-utils.spec.ts b/web/src/lib/utils/exif-utils.spec.ts
deleted file mode 100644
index 56b7b57ce5..0000000000
--- a/web/src/lib/utils/exif-utils.spec.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { AssetResponseDto } from '@immich/sdk';
-import { getExifCount } from '$lib/utils/exif-utils';
-
-describe('getting the exif count', () => {
- it('returns 0 when exifInfo is undefined', () => {
- const asset = {};
- expect(getExifCount(asset as AssetResponseDto)).toBe(0);
- });
-
- it('returns 0 when exifInfo is empty', () => {
- const asset = { exifInfo: {} };
- expect(getExifCount(asset as AssetResponseDto)).toBe(0);
- });
-
- it('returns the correct count of non-null exifInfo properties', () => {
- const asset = { exifInfo: { fileSizeInByte: 200, rating: 5, fNumber: null } };
- expect(getExifCount(asset as AssetResponseDto)).toBe(2);
- });
-
- it('ignores null, undefined and empty properties in exifInfo', () => {
- const asset = { exifInfo: { fileSizeInByte: 200, rating: null, fNumber: undefined, description: '' } };
- expect(getExifCount(asset as AssetResponseDto)).toBe(1);
- });
-
- it('returns the correct count when all exifInfo properties are non-null', () => {
- const asset = { exifInfo: { fileSizeInByte: 200, rating: 5, fNumber: 1, description: 'test' } };
- expect(getExifCount(asset as AssetResponseDto)).toBe(4);
- });
-});
diff --git a/web/src/lib/utils/exif-utils.ts b/web/src/lib/utils/exif-utils.ts
deleted file mode 100644
index 75a6bbd055..0000000000
--- a/web/src/lib/utils/exif-utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import type { AssetResponseDto } from '@immich/sdk';
-
-export const getExifCount = (asset: AssetResponseDto) => {
- return Object.values(asset.exifInfo ?? {}).filter(Boolean).length;
-};
diff --git a/web/src/lib/utils/string-utils.ts b/web/src/lib/utils/string-utils.ts
index 3795af40c7..0170c34737 100644
--- a/web/src/lib/utils/string-utils.ts
+++ b/web/src/lib/utils/string-utils.ts
@@ -5,13 +5,3 @@ export const removeAccents = (str: string) => {
export const normalizeSearchString = (str: string) => {
return removeAccents(str.toLocaleLowerCase());
};
-
-export const buildDateString = (year: number, month?: number, day?: number) => {
- return [
- year.toString(),
- month && !Number.isNaN(month) ? month.toString() : undefined,
- day && !Number.isNaN(day) ? day.toString() : undefined,
- ]
- .filter((date) => date !== undefined)
- .join('-');
-};
diff --git a/web/src/lib/utils/workflow.ts b/web/src/lib/utils/workflow.ts
index 61702f4264..b8dc44cc67 100644
--- a/web/src/lib/utils/workflow.ts
+++ b/web/src/lib/utils/workflow.ts
@@ -30,9 +30,6 @@ export const getTriggerDescription = ($t: MessageFormatter, type: WorkflowTrigge
case WorkflowTrigger.AssetMetadataExtraction: {
return $t('trigger_asset_metadata_extraction_description');
}
- default: {
- return type;
- }
}
};
@@ -79,10 +76,6 @@ export const getWorkflowDefaultConfig = (schema: JSONSchemaProperty) => {
config[key] = property.properties ? getWorkflowDefaultConfig(property) : {};
break;
}
-
- default: {
- console.log(`Unknown configuration type: ${property.type}`);
- }
}
}