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 item = result["Photo_Categories"][0];
|
||||||
|
|
||||||
const imageSize =
|
const imageSize = getImageSize(item["thumbnail"]["width"],
|
||||||
getImageSize(item["thumbnail"]["width"], item["thumbnail"]["height"], 1.5);
|
item["thumbnail"]["height"], 1.5);
|
||||||
|
|
||||||
let categories: PhotoAlbumCategory = {
|
let categories: PhotoAlbumCategory = {
|
||||||
id: item["id"],
|
id: item["id"],
|
||||||
title: item["title"],
|
title: item["title"],
|
||||||
url: item["url"],
|
url: item["url"],
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: item["thumbnail"]["filename_disk"],
|
url: getImageUrl(item["thumbnail"]["filename_disk"]),
|
||||||
width: imageSize.width,
|
width: imageSize.width,
|
||||||
height: imageSize.height
|
height: imageSize.height
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,6 +136,21 @@ export async function getPage(settings: GlobalSettings, route: string): Promise<
|
|||||||
|
|
||||||
const category = await getPhotoCategory(`/${params["C"]}`);
|
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 {
|
return {
|
||||||
route: route,
|
route: route,
|
||||||
pageType: "PhotoCategory",
|
pageType: "PhotoCategory",
|
||||||
|
|||||||
Reference in New Issue
Block a user