diff --git a/src/App.tsx b/src/App.tsx index 5f5282a..abd9968 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2540,6 +2540,7 @@ export default function App() { initialFiles={pendingFiles} existing={photos} cloud={cloudUser ? { uploadOriginal, push: pushPhoto } : null} + local={localMode} onNeedServer={() => { setImportOpen(false); setCloudError(null); diff --git a/src/components/ImportModal.tsx b/src/components/ImportModal.tsx index ca58c23..ae091bf 100644 --- a/src/components/ImportModal.tsx +++ b/src/components/ImportModal.tsx @@ -18,6 +18,8 @@ interface Props { immichEnabled?: boolean; onCreateImmichGallery?: (eventId: string) => Promise; cloud?: CloudImport | null; + /** Desktop bundle: the decoder runs on this PC rather than a team server. */ + local?: boolean; onNeedServer: () => void; } @@ -32,6 +34,7 @@ export default function ImportModal({ immichEnabled = false, onCreateImmichGallery, cloud, + local = false, onNeedServer, }: Props) { const startId = initialEventId !== 'all' && initialEventId !== 'unsorted' ? initialEventId : events[0]?.id ?? '__new'; @@ -278,7 +281,8 @@ export default function ImportModal({ Drop photos here

or click to choose files. JPEG, PNG, WebP, AVIF, TIFF and camera raw (CR2, CR3, NEF, - ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs the team server. + ARW, ORF, RW2, RAF, DNG, PEF…) — raw needs{' '} + {local ? 'the local engine' : 'the team server'}.

{rawCount} raw file{rawCount === 1 ? '' : 's'} cannot be read by the browser. {' '} - They are decoded by the team server, so sign in before importing — or import them later - from the library. - + {local + ? 'They are decoded by the local engine on this PC. Check that Luminary is running, then import again.' + : 'They are decoded by the team server, so sign in before importing — or import them later from the library.'} + {!local && ( + + )} )} {rawCount > 0 && cloud && (
- Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each file - usually takes 2–4 seconds. + {local + ? 'Raw files are demosaiced by the Luminary local engine (LibRaw) on this PC, a few ' + + 'at a time in parallel. Each file usually takes 2–4 seconds, and nothing leaves your computer.' + : 'Raw files are demosaiced by the server (LibRaw), a few at a time in parallel. Each ' + + 'file usually takes 2–4 seconds.'}
)} diff --git a/src/components/JoinPage.tsx b/src/components/JoinPage.tsx index e17b112..1d62c2e 100644 --- a/src/components/JoinPage.tsx +++ b/src/components/JoinPage.tsx @@ -101,7 +101,7 @@ LUMINARY {loadError && ( <> Invite -

Can’t reach the server

+

Can’t reach Luminary

{loadError}

Go to Luminary diff --git a/src/lib/api.ts b/src/lib/api.ts index 79cb58b..0a30be2 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -35,6 +35,17 @@ export interface UploadResult { note?: string | null; } +/** + * True once /api/health reports LUMINARY_LOCAL=1: the engine runs inside this + * app's own folder, so copy must not send users looking for a remote server. + */ +let localEngine = false; + +/** Whether this app talks to the engine in its own bundle (desktop mode). */ +export function isLocalEngine(): boolean { + return localEngine; +} + export class ApiError extends Error { status: number; constructor(message: string, status: number) { @@ -48,7 +59,10 @@ export async function request(path: string, init?: RequestInit): Promise { try { res = await fetch(path, { credentials: 'same-origin', ...init }); } catch { - throw new ApiError('Cannot reach the Luminary server', 0); + throw new ApiError( + localEngine ? 'Cannot reach the Luminary local engine' : 'Cannot reach the Luminary server', + 0, + ); } if (!res.ok) { let message = `Request failed (${res.status})`; @@ -78,6 +92,7 @@ export async function getHealth(): Promise { const res = await fetch('/api/health', { credentials: 'same-origin' }); if (!res.ok) return null; const body = (await res.json()) as Health; + localEngine = body?.local === true; return body?.ok ? body : null; } catch { return null;