Fix category index thumbnail

This commit is contained in:
itsfinniii
2026-04-27 16:55:43 +02:00
parent c112a69f0e
commit 7116aa2348
2 changed files with 18 additions and 3 deletions

View File

@@ -37,15 +37,15 @@ export async function getPhotoCategory(url: string): Promise<PhotoAlbumCategory>
const item = result["Photo_Categories"][0];
const imageSize =
getImageSize(item["thumbnail"]["width"], item["thumbnail"]["height"], 1.5);
const imageSize = getImageSize(item["thumbnail"]["width"],
item["thumbnail"]["height"], 1.5);
let categories: PhotoAlbumCategory = {
id: item["id"],
title: item["title"],
url: item["url"],
thumbnail: {
url: item["thumbnail"]["filename_disk"],
url: getImageUrl(item["thumbnail"]["filename_disk"]),
width: imageSize.width,
height: imageSize.height
}

View File

@@ -136,6 +136,21 @@ export async function getPage(settings: GlobalSettings, route: string): Promise<
const category = await getPhotoCategory(`/${params["C"]}`);
const resizedThumbnail = getImageSize(category.thumbnail.width, category.thumbnail.height, 0.756);
const thumbnail = await getImage({
src: category.thumbnail.url,
width: resizedThumbnail.width,
height: resizedThumbnail.height,
format: "jpeg"
});
category.thumbnail = {
url: `${settings.website.domainName}${thumbnail.src}`,
width: resizedThumbnail.width,
height: resizedThumbnail.height
};
return {
route: route,
pageType: "PhotoCategory",