#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
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "immich-public-proxy",
"version": "1.6.2",
"version": "1.6.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "immich-public-proxy",
"version": "1.6.2",
"version": "1.6.3",
"license": "AGPL-3.0",
"dependencies": {
"archiver": "^7.0.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "immich-public-proxy",
"version": "1.6.2",
"version": "1.6.3",
"scripts": {
"dev": "ts-node src/index.ts",
"build": "npx tsc",
+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
+2
View File
@@ -8,6 +8,7 @@ export interface Asset {
key: string;
originalFileName?: string;
password?: string;
fileCreatedAt: string;
type: AssetType;
isTrashed: boolean;
}
@@ -21,6 +22,7 @@ export interface SharedLink {
album?: {
id: string;
albumName?: string;
order?: string;
}
expiresAt: string | null;
}