#61 don't assume a fileCreatedAt property

This commit is contained in:
Alan Grainger
2025-02-02 21:21:49 +08:00
parent f1c7210685
commit fadff87e13
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -152,9 +152,9 @@ class Immich {
// Sort album if there is a sort order specified // Sort album if there is a sort order specified
const sortOrder = link.album?.order const sortOrder = link.album?.order
if (sortOrder === 'asc') { if (sortOrder === 'asc') {
link.assets.sort((a, b) => a?.fileCreatedAt?.localeCompare(b.fileCreatedAt)) link.assets.sort((a, b) => a?.fileCreatedAt?.localeCompare(b.fileCreatedAt || '') || 0)
} else if (sortOrder === 'desc') { } else if (sortOrder === 'desc') {
link.assets.sort((a, b) => b?.fileCreatedAt?.localeCompare(a.fileCreatedAt)) link.assets.sort((a, b) => b?.fileCreatedAt?.localeCompare(a.fileCreatedAt || '') || 0)
} }
return { return {
valid: true, valid: true,
+1 -1
View File
@@ -10,7 +10,7 @@ export interface Asset {
key: string; key: string;
originalFileName?: string; originalFileName?: string;
password?: string; password?: string;
fileCreatedAt: string; fileCreatedAt?: string; // May not exist - see https://github.com/alangrainger/immich-public-proxy/issues/61
type: AssetType; type: AssetType;
isTrashed: boolean; isTrashed: boolean;
} }