Skip to content

Commit

Permalink
1.6.3
Browse files Browse the repository at this point in the history
#53 Add sort order for albums
  • Loading branch information
alangrainger committed Jan 24, 2025
1 parent f2b751c commit f4a2cd1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<p align="center" width="100%">
<a href="https://hub.docker.com/r/alangrainger/immich-public-proxy/tags">
<img alt="Docker pulls" src="https://badgen.net/docker/pulls/alangrainger/immich-public-proxy?v1.6.2&icon=docker&label=docker%20pulls&color=green&scale=1.1"></a>
<img alt="Docker pulls" src="https://badgen.net/docker/pulls/alangrainger/immich-public-proxy?v1.6.3&icon=docker&label=docker%20pulls&color=green&scale=1.1"></a>
<a href="https://github.com/alangrainger/immich-public-proxy/releases/latest">
<img alt="Latest release" src="https://badgen.net/static/release/v1.6.2/blue?scale=1.1"></a>
<img alt="Latest release" src="https://badgen.net/static/release/v1.6.3/blue?scale=1.1"></a>
<a href="https://immich-demo.note.sx/share/gJfs8l4LcJJrBUpjhMnDoKXFt1Tm5vKXPbXl8BgwPtLtEBCOOObqbQdV5i0oun5hZjQ"><img alt="Open demo gallery" src="https://badgen.net/static/↗🖼️/live%20demo/green?scale=1.1"></a>
</p>

Expand Down
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions app/src/immich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface Asset {
key: string;
originalFileName?: string;
password?: string;
fileCreatedAt: string;
type: AssetType;
isTrashed: boolean;
}
Expand All @@ -21,6 +22,7 @@ export interface SharedLink {
album?: {
id: string;
albumName?: string;
order?: string;
}
expiresAt: string | null;
}
Expand Down

0 comments on commit f4a2cd1

Please sign in to comment.