#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
const sortOrder = link.album?.order
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') {
link.assets.sort((a, b) => b?.fileCreatedAt?.localeCompare(a.fileCreatedAt))
link.assets.sort((a, b) => b?.fileCreatedAt?.localeCompare(a.fileCreatedAt || '') || 0)
}
return {
valid: true,