feat: update Immich integration to use dynamic image URLs and enhance image retrieval logic
This commit is contained in:
@@ -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"
|
||||
/>
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user