Fix category index thumbnail
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user