{content};
+ if (!props.linkable || !props.media.year) return {content};
return (
Date: Wed, 27 Mar 2024 23:19:35 +0530
Subject: [PATCH 3/7] Revert "Update tmdb.ts"
This reverts commit c4f68615cd2fc0efe959506e4747439ff6165f87.
---
src/backend/metadata/tmdb.ts | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/src/backend/metadata/tmdb.ts b/src/backend/metadata/tmdb.ts
index 88412c84..b143b312 100644
--- a/src/backend/metadata/tmdb.ts
+++ b/src/backend/metadata/tmdb.ts
@@ -173,17 +173,12 @@ export async function multiSearch(
language: "en-US",
page: 1,
});
- const currentDate = new Date();
- // filter out results that aren't movies or shows or are unreleased
- const results = data.results.filter((r) => {
- if (r.media_type === TMDBContentTypes.MOVIE) {
- return new Date(r.release_date) <= currentDate;
- }
- if (r.media_type === TMDBContentTypes.TV) {
- return new Date(r.first_air_date) <= currentDate;
- }
- return false;
- });
+ // filter out results that aren't movies or shows
+ const results = data.results.filter(
+ (r) =>
+ r.media_type === TMDBContentTypes.MOVIE ||
+ r.media_type === TMDBContentTypes.TV,
+ );
return results;
}
From 4386772404de469d3980252fc38aa327a95846a6 Mon Sep 17 00:00:00 2001
From: Honkertonken <94032937+Honkertonken@users.noreply.github.com>
Date: Thu, 28 Mar 2024 13:27:05 +0530
Subject: [PATCH 4/7] Update MediaCard.tsx
---
src/components/media/MediaCard.tsx | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx
index ac6c243c..ce4eeffe 100644
--- a/src/components/media/MediaCard.tsx
+++ b/src/components/media/MediaCard.tsx
@@ -35,13 +35,15 @@ function MediaCardContent({
const { t } = useTranslation();
const percentageString = `${Math.round(percentage ?? 0).toFixed(0)}%`;
- const canLink = linkable && !closable && !!media.year;
+ const currentYear = new Date().getFullYear();
+ const isReleased = media.year && media.year < currentYear;
+ const canLink = linkable && !closable && isReleased;
const dotListContent = [t(`media.types.${media.type}`)];
- if (media.year) {
+ if (isReleased) {
dotListContent.push(media.year.toFixed());
} else {
- dotListContent.push(t("Unreleased"));
+ dotListContent.push(t("media.unreleased"));
}
return (
@@ -146,7 +148,9 @@ function MediaCardContent({
export function MediaCard(props: MediaCardProps) {
const content = ;
- const canLink = props.linkable && !props.closable;
+ const currentYear = new Date().getFullYear();
+ const isReleased = props.media.year && props.media.year < currentYear;
+ const canLink = props.linkable && !props.closable && isReleased;
let link = canLink
? `/media/${encodeURIComponent(mediaItemToId(props.media))}`
@@ -161,7 +165,7 @@ export function MediaCard(props: MediaCardProps) {
}
}
- if (!props.linkable || !props.media.year) return {content};
+ if (!canLink) return {content};
return (
Date: Thu, 28 Mar 2024 13:36:56 +0530
Subject: [PATCH 5/7] Update MediaCard.tsx
---
src/components/media/MediaCard.tsx | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/components/media/MediaCard.tsx b/src/components/media/MediaCard.tsx
index ce4eeffe..937ff1c6 100644
--- a/src/components/media/MediaCard.tsx
+++ b/src/components/media/MediaCard.tsx
@@ -36,11 +36,11 @@ function MediaCardContent({
const percentageString = `${Math.round(percentage ?? 0).toFixed(0)}%`;
const currentYear = new Date().getFullYear();
- const isReleased = media.year && media.year < currentYear;
- const canLink = linkable && !closable && isReleased;
+ const canLink =
+ linkable && !closable && media.year && media.year < currentYear;
const dotListContent = [t(`media.types.${media.type}`)];
- if (isReleased) {
+ if (media.year && media.year < currentYear) {
dotListContent.push(media.year.toFixed());
} else {
dotListContent.push(t("media.unreleased"));
@@ -149,8 +149,11 @@ export function MediaCard(props: MediaCardProps) {
const content = ;
const currentYear = new Date().getFullYear();
- const isReleased = props.media.year && props.media.year < currentYear;
- const canLink = props.linkable && !props.closable && isReleased;
+ const canLink =
+ props.linkable &&
+ !props.closable &&
+ props.media.year &&
+ props.media.year < currentYear;
let link = canLink
? `/media/${encodeURIComponent(mediaItemToId(props.media))}`
From d82de1f7c89c214ec983bc244f4f1d3381410342 Mon Sep 17 00:00:00 2001
From: Captain Jack Sparrow <163903675+sussy-code@users.noreply.github.com>
Date: Thu, 28 Mar 2024 05:17:17 -0400
Subject: [PATCH 6/7] Better scrape error text for extension (#1042)
* Add better scrape error messages for the extension
* Remove config.js silly me
* Polish and resolve issues
* Update src/pages/parts/player/ScrapeErrorPart.tsx
Co-authored-by: William Oldham
* Update src/pages/parts/player/ScrapeErrorPart.tsx
Co-authored-by: William Oldham
* Update src/pages/parts/player/ScrapeErrorPart.tsx
Co-authored-by: William Oldham
* Update src/pages/parts/player/ScrapeErrorPart.tsx
Co-authored-by: William Oldham
* Update src/pages/parts/player/ScrapeErrorPart.tsx
Co-authored-by: William Oldham
* Update src/pages/parts/player/ScrapeErrorPart.tsx
Co-authored-by: William Oldham
* Fix duplicate button value
* Resolve issues
* Ok now i fixed it all
* Apply suggestions from code review
* I am dum
---------
Co-authored-by: Cooper Ransom
Co-authored-by: William Oldham
---
index.html | 2 +-
src/assets/locales/en.json | 7 +++
src/pages/onboarding/OnboardingExtension.tsx | 23 +-------
src/pages/parts/player/ScrapeErrorPart.tsx | 61 +++++++++++++++++++-
src/utils/extension.ts | 20 +++++++
5 files changed, 90 insertions(+), 23 deletions(-)
create mode 100644 src/utils/extension.ts
diff --git a/index.html b/index.html
index 1d1c3577..4555b17a 100644
--- a/index.html
+++ b/index.html
@@ -162,4 +162,4 @@