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

This commit is contained in:
Mees Frensel 2026-06-15 14:54:51 +02:00 committed by GitHub
parent cc54de87aa
commit 5f1a180d1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1 additions and 60 deletions

View file

@ -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;
}

View file

@ -1,7 +0,0 @@
export interface ResetOptions {
default?: boolean;
}
export interface SearchOptions {
force?: boolean;
}

View file

@ -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);
});
});

View file

@ -1,5 +0,0 @@
import type { AssetResponseDto } from '@immich/sdk';
export const getExifCount = (asset: AssetResponseDto) => {
return Object.values(asset.exifInfo ?? {}).filter(Boolean).length;
};

View file

@ -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('-');
};

View file

@ -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}`);
}
}
}