diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx
index cad3ae6a..563e4d9b 100644
--- a/src/components/media/MediaCard.tsx
+++ b/src/components/media/MediaCard.tsx
@@ -35,10 +35,18 @@ function MediaCardContent({
const { t } = useTranslation();
const percentageString = `${Math.round(percentage ?? 0).toFixed(0)}%`;
- const canLink = linkable && !closable;
+ const currentYear = new Date().getFullYear();
+ const canLink =
+ linkable && !closable && media.year && media.year <= currentYear;
const dotListContent = [t(`media.types.${media.type}`)];
- if (media.year) dotListContent.push(media.year.toFixed());
+ 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"));
+ }
return (
;
- const canLink = props.linkable && !props.closable;
+ const currentYear = new Date().getFullYear();
+ const canLink =
+ props.linkable &&
+ !props.closable &&
+ props.media.year &&
+ props.media.year <= currentYear;
let link = canLink
? `/media/${encodeURIComponent(mediaItemToId(props.media))}`
@@ -157,7 +170,7 @@ export function MediaCard(props: MediaCardProps) {
}
}
- if (!props.linkable) return {content};
+ if (!canLink) return {content};
return (