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:
Ralksta
2026-08-25 10:08:12 +02:00
committed by GitHub
parent 10ec68f493
commit a813433891
73 changed files with 4697 additions and 453 deletions

View File

@@ -11,6 +11,8 @@ import { decodeAssetId } from '@/lib/tokens';
import { getConfig } from '@/lib/config';
import { checkRateLimit, getClientIp, retryAfterSeconds } from '@/lib/rate-limit';
import { siteLockResponse } from '@/lib/auth';
import { assetLocationPrecision } from '@/lib/assetLocation';
import { placeLabel } from '@/lib/mapPrecision';
export async function GET(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
const config = getConfig();
@@ -73,6 +75,13 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
const exif = asset.exifInfo;
const caption = show.caption ? exif.description?.trim() || undefined : undefined;
const place = show.location
? placeLabel(await assetLocationPrecision(assetId), {
city: exif.city ?? '',
country: exif.country ?? '',
})
: { city: '', country: '' };
const payload = {
...(show.camera
? {
@@ -89,7 +98,15 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
iso: exif.iso,
}
: {}),
...(show.location ? { city: exif.city, country: exif.country } : {}),
// Two gates, not one. `exifDisplay.location` decides whether this site
// publishes places at all; the album's `location:` decides how precisely
// this photograph may be placed — the same setting the map obeys, which
// used to stop at the map (#469).
// Emitted only when there is something to say. An empty string is not
// null, so keeping the keys would defeat the "no data" check below and
// render the blank panel it exists to prevent.
...(place.city ? { city: place.city } : {}),
...(place.country ? { country: place.country } : {}),
...(caption ? { description: caption } : {}),
};

View File

@@ -13,7 +13,7 @@ vi.mock('@/lib/config', () => ({
}));
vi.mock('@/lib/immich', () => ({
immich: { getAssetInfo: vi.fn() },
immich: { getAssetInfo: vi.fn(), getAlbum: vi.fn() },
ImmichUnavailableError: class ImmichUnavailableError extends Error {},
}));
@@ -36,6 +36,7 @@ import { NextRequest } from 'next/server';
const mockConfig = getConfig as unknown as ReturnType<typeof vi.fn>;
const mockAssetInfo = immich.getAssetInfo as unknown as ReturnType<typeof vi.fn>;
const mockGetAlbum = immich.getAlbum as unknown as ReturnType<typeof vi.fn>;
const EXIF_ASSET = {
exifInfo: {
@@ -64,6 +65,9 @@ function configWith(raw?: ExifDisplayYaml, exifOnHover?: boolean) {
exifOnHover: exifOnHover !== false,
exif: resolveExifDisplay(raw, exifOnHover),
rateLimitRpm: 120,
// No album restricts its location, so the place comes through as the
// asset carries it — the shape getConfig() always builds (#469).
albumLocationPrecision: {},
};
}
@@ -152,3 +156,40 @@ describe('GET /api/exif/[id] captions', () => {
expect(res.status).toBe(404);
});
});
/**
* `location:` used to govern the map and nothing else, so an album asking to
* be absent from it still named its city here (#469).
*/
describe('GET /api/exif/[id] album location precision', () => {
/** The album that carries the asset the mocked token decodes to. */
const carrying = { id: 'album-a', assets: [{ id: 'asset-uuid' }] };
async function respond(precision: Record<string, string>) {
mockConfig.mockReturnValue({ ...configWith(), albumLocationPrecision: precision });
mockAssetInfo.mockResolvedValue(EXIF_ASSET);
mockGetAlbum.mockResolvedValue(carrying);
const res = await GET(new NextRequest('http://localhost/api/exif/token'), {
params: Promise.resolve({ id: 'token' }),
});
return res.json();
}
it('names the city when nothing restricts it', async () => {
expect(await respond({})).toMatchObject({ city: 'Vienna', country: 'Austria' });
});
it('drops the city but keeps the country at country precision', async () => {
const body = await respond({ 'album-a': 'country' });
expect(body.country).toBe('Austria');
expect(body).not.toHaveProperty('city');
});
it('names no place at all when the album is hidden', async () => {
const body = await respond({ 'album-a': 'hidden' });
expect(body).not.toHaveProperty('city');
expect(body).not.toHaveProperty('country');
// The rest of the panel is untouched.
expect(body.model).toBe('X-T5');
});
});