#53 Add sort order for albums
This commit is contained in:
Alan Grainger
2025-01-24 21:29:28 +08:00
parent f2b751c42f
commit f4a2cd17b7
5 changed files with 14 additions and 5 deletions
+7
View File
@@ -148,6 +148,13 @@ class Immich {
asset.key = key
asset.password = password
})
// 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))
} else if (sortOrder === 'desc') {
link.assets.sort((a, b) => b.fileCreatedAt.localeCompare(a.fileCreatedAt))
}
return {
valid: true,
link