1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

Update MediaCard.tsx

This commit is contained in:
Honkertonken 2024-03-28 16:47:18 +05:30 committed by GitHub
parent 6efce6bdf6
commit bfee71f446
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,10 +37,12 @@ function MediaCardContent({
const currentYear = new Date().getFullYear(); const currentYear = new Date().getFullYear();
const canLink = const canLink =
linkable && !closable && media.year && media.year < currentYear; linkable && !closable && media.year && media.year <= currentYear;
const dotListContent = [t(`media.types.${media.type}`)]; const dotListContent = [t(`media.types.${media.type}`)];
if (media.year && media.year < currentYear) { if (media.year && media.year > currentYear) {
dotListContent.push(`${media.year}`, t("media.unreleased"));
} else if (media.year) {
dotListContent.push(media.year.toFixed()); dotListContent.push(media.year.toFixed());
} else { } else {
dotListContent.push(t("media.unreleased")); dotListContent.push(t("media.unreleased"));
@ -153,7 +155,7 @@ export function MediaCard(props: MediaCardProps) {
props.linkable && props.linkable &&
!props.closable && !props.closable &&
props.media.year && props.media.year &&
props.media.year < currentYear; props.media.year <= currentYear;
let link = canLink let link = canLink
? `/media/${encodeURIComponent(mediaItemToId(props.media))}` ? `/media/${encodeURIComponent(mediaItemToId(props.media))}`