Fix thumbnail for Photo

This commit is contained in:
itsfinniii
2026-04-05 22:23:31 +02:00
parent f95f792775
commit b73066352e
5 changed files with 30 additions and 10 deletions

View File

@@ -3,13 +3,13 @@ import { print } from "graphql";
import getPhotos from '@/graphql/photos/getPhotos.graphql';
import md5 from "md5";
export async function getPhotoFromHash(albumUrl: string, hash: string): Promise<PhotoAlbumPhoto | null> {
export async function getPhotoFromHash(albumUrl: string, hash: string): Promise<PhotoAlbumItem | null> {
const client = await createDirectusConnection();
const result = await client.query(print(getPhotos), {
albumUrl: albumUrl
});
let object: PhotoAlbumPhoto | null = null;
let object: PhotoAlbumItem | null = null;
result["Photo_Albums"][0]["photos"].forEach((photo: any) => {
/*
@@ -29,9 +29,13 @@ export async function getPhotoFromHash(albumUrl: string, hash: string): Promise<
id: photo.id,
text: photo.text,
photo: {
url: photo.photo.url,
url: photo.photo.filename_disk,
width: photo.photo.width,
height: photo.photo.height
},
album: {
url: result["Photo_Albums"][0].url,
title: result["Photo_Albums"][0].title
}
}
}