Feat/journey external picture provider rework (#1632)

* feat(journey): add contextual external photo browser

* fix(Journey) added missing language keys for new Journey feature

* fix(Journey) fixing missing gps requests aswell as added protection against duplicate entries
This commit is contained in:
SimMesg20
2026-07-23 21:35:12 +02:00
committed by GitHub
parent 8855b5581d
commit 4d3d16389e
35 changed files with 618 additions and 44 deletions
@@ -67,6 +67,11 @@ export type AlbumsList = {
export type Asset = {
id: string;
takenAt: string;
mediaType?: string;
city?: string | null;
country?: string | null;
lat?: number | null;
lng?: number | null;
};
export type AssetsList = {
@@ -289,4 +294,4 @@ export async function pipeAsset(url: string, response: Response, headers?: Recor
response.status(500).json({ error: 'Failed to fetch asset' });
}
}
}
}
@@ -198,6 +198,7 @@ export async function searchPhotos(
// `isVisible` either, so they still return hidden assets. isVisibleAsset()
// below is the only guard on those versions. Do not remove it.
visibility: 'timeline',
withExif: true,
size,
page,
}),
@@ -217,6 +218,8 @@ export async function searchPhotos(
takenAt: a.fileCreatedAt || a.createdAt,
city: a.exifInfo?.city || null,
country: a.exifInfo?.country || null,
lat: typeof a.exifInfo?.latitude === 'number' ? a.exifInfo.latitude : null,
lng: typeof a.exifInfo?.longitude === 'number' ? a.exifInfo.longitude : null,
mediaType: a.type === 'VIDEO' ? 'video' : 'image',
}));
return { assets, hasMore: items.length >= size };
@@ -278,8 +278,8 @@ function _normalizeSynologyPhotoInfo(item: SynologyPhotoItem): AssetInfo {
aperture: exif.aperture || null,
shutter: exif.exposure_time || null,
iso: exif.iso || null,
lat: gps.latitude || null,
lng: gps.longitude || null,
lat: typeof gps.latitude === 'number' ? gps.latitude : null,
lng: typeof gps.longitude === 'number' ? gps.longitude : null,
orientation: item.additional?.orientation || null,
description: item.additional?.description || null,
width: item.additional?.resolution?.width || null,
@@ -555,7 +555,7 @@ export async function searchSynologyPhotos(userId: number, from?: string, to?: s
offset,
limit,
keyword: '.',
additional: ['thumbnail', 'address'],
additional: ['thumbnail', 'address', 'gps'],
};
if (from || to) {
@@ -703,4 +703,3 @@ export async function streamSynologyAsset(
const url = _buildSynologyEndpoint(synology_credentials.data.synology_url, params.toString());
await pipeAsset(url, response, undefined, undefined, 'public, max-age=86400', { rejectUnauthorized: !synology_credentials.data.synology_skip_ssl })
}