1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-02 19:55:18 +02:00

feat: update Immich integration to use dynamic image URLs and enhance image retrieval logic

This commit is contained in:
Sean Morley 2025-06-02 21:25:07 -04:00
parent 937db00226
commit 45e195a84e
5 changed files with 112 additions and 78 deletions

View file

@ -209,7 +209,7 @@
<div class="flex flex-col items-center gap-2" class:blur-sm={loading}>
<!-- svelte-ignore a11y-img-redundant-alt -->
<img
src={`/immich/${image.id}`}
src={`${image.image_url}`}
alt="Image from Immich"
class="h-24 w-24 object-cover rounded-md"
/>

View file

@ -16,8 +16,24 @@ export const GET: RequestHandler = async (event) => {
});
}
// Proxy the request to the backend
const res = await fetch(`${endpoint}/api/integrations/immich/get/${key}`, {
let integrationFetch = await fetch(`${endpoint}/api/integrations/immich`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Cookie: `sessionid=${sessionid}`
}
});
if (!integrationFetch.ok) {
return new Response(JSON.stringify({ error: 'Failed to fetch integration data' }), {
status: integrationFetch.status,
headers: { 'Content-Type': 'application/json' }
});
}
const integrationData = await integrationFetch.json();
const integrationId = integrationData.id;
// Proxy the request to the backend{
const res = await fetch(`${endpoint}/api/integrations/immich/${integrationId}/get/${key}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',