release: v0.13.0 (#535)
Twenty-nine commits since v0.12.0. See CHANGELOG.md for the full list and the upgrade notes. Ten additions — the SEO package (site URL, robots.txt, sitemap.xml, JSON-LD), slideshow mode, opt-in original downloads, copy-link, previous/next album navigation, alt text from the Immich description, per-album location precision, the update notice, a Help tab, and a subpage cover grid separate from its photo grid. Two fixes: CJK album slugs, and the lightbox control bar. Photo of the Day (#476) was built on `dev` and reverted as not planned; it never appears in a release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmsHVRL9yQvckUB1ZpVWre --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ralksta <ralksta@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
31
lib/urls.ts
31
lib/urls.ts
@@ -96,6 +96,37 @@ export function assetExifSummary(asset: Pick<ImmichAsset, 'exifInfo'>): ExifSumm
|
||||
return { camera, lens, focalLength };
|
||||
}
|
||||
|
||||
/**
|
||||
* The download URL for an original file (#475).
|
||||
*
|
||||
* Carries the album as well as the asset: the route authorises the download
|
||||
* against the album that offered it, and checks the asset really belongs to
|
||||
* that album.
|
||||
*/
|
||||
export function downloadUrl(albumId: string, assetId: string): string {
|
||||
return `/api/download/${encodeAssetId(albumId)}/${encodeAssetId(assetId)}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Immich asset description, trimmed, for use as image alt text.
|
||||
*
|
||||
* Gated on the `caption` EXIF group rather than served unconditionally. That
|
||||
* switch exists because the description is the one field that can hold private
|
||||
* notes (#506), and an alt attribute publishes it to crawlers and view-source
|
||||
* exactly as a visible caption would. A site that has switched captions off has
|
||||
* said it does not want that text on the page.
|
||||
*
|
||||
* Returns undefined when there is nothing to say, which leaves `alt=""` — the
|
||||
* correct markup for a decorative image, and better than inventing filler.
|
||||
*/
|
||||
export function assetCaption(
|
||||
asset: Pick<ImmichAsset, 'exifInfo'>,
|
||||
showCaption: boolean,
|
||||
): string | undefined {
|
||||
if (!showCaption) return undefined;
|
||||
return asset.exifInfo?.description?.trim() || undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute the natural aspect ratio (width / height) from EXIF dimensions.
|
||||
* Returns undefined if dimensions are not available.
|
||||
|
||||
Reference in New Issue
Block a user