Skip to content

Commit

Permalink
fix(images): not always returning logos in getLogo
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
  • Loading branch information
ferferga committed Jan 27, 2025
1 parent 6c48bed commit 9a9eeae
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions frontend/src/utils/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,29 +445,28 @@ export function getLogo(
tag?: string;
} = {}
): ImageUrlInfo {
let imgType;
const imgType = ImageType.Logo;
let imgTag;
let itemId: string | null | undefined = item.Id;

if (tag) {
imgType = ImageType.Logo;
imgTag = tag;
} else if (item.ImageTags?.Logo) {
imgType = ImageType.Logo;
imgTag = item.ImageTags.Logo;
} else if (item.ParentLogoImageTag && item.ParentLogoItemId) {
imgType = ImageType.Logo;
imgTag = item.ParentLogoImageTag;
itemId = item.ParentLogoItemId;
}

return {
url: getImageUrlWithSize(itemId ?? '', {
width,
quality,
ratio
}, imgType),
url: isNil(imgTag)
? undefined
: getImageUrlWithSize(itemId ?? '', {
width,
quality,
ratio
}, imgType),
blurhash:
imgType && imgTag ? item.ImageBlurHashes?.[imgType]?.[imgTag] : undefined
imgTag ? item.ImageBlurHashes?.[imgType]?.[imgTag] : undefined
};
}

0 comments on commit 9a9eeae

Please sign in to comment.