1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +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 canLink =
linkable && !closable && media.year && media.year < currentYear;
linkable && !closable && media.year && media.year <= currentYear;
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());
} else {
dotListContent.push(t("media.unreleased"));
@ -153,7 +155,7 @@ export function MediaCard(props: MediaCardProps) {
props.linkable &&
!props.closable &&
props.media.year &&
props.media.year < currentYear;
props.media.year <= currentYear;
let link = canLink
? `/media/${encodeURIComponent(mediaItemToId(props.media))}`