From 04fbd00d4ac29045592588ef8b664d1916991e37 Mon Sep 17 00:00:00 2001 From: Fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Sun, 11 Jun 2023 06:14:14 +0500 Subject: [PATCH 1/2] fix: fixes RT ratings for tv shows (#3492) fix #3491 --- server/api/rottentomatoes.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/server/api/rottentomatoes.ts b/server/api/rottentomatoes.ts index 7695e398..99a74eb1 100644 --- a/server/api/rottentomatoes.ts +++ b/server/api/rottentomatoes.ts @@ -17,7 +17,7 @@ interface RTAlgoliaHit { title: string; titles: string[]; description: string; - releaseYear: string; + releaseYear: number; rating: string; genres: string[]; updateDate: string; @@ -111,22 +111,19 @@ class RottenTomatoes extends ExternalAPI { // First, attempt to match exact name and year let movie = contentResults.hits.find( - (movie) => movie.releaseYear === year.toString() && movie.title === name + (movie) => movie.releaseYear === year && movie.title === name ); // If we don't find a movie, try to match partial name and year if (!movie) { movie = contentResults.hits.find( - (movie) => - movie.releaseYear === year.toString() && movie.title.includes(name) + (movie) => movie.releaseYear === year && movie.title.includes(name) ); } // If we still dont find a movie, try to match just on year if (!movie) { - movie = contentResults.hits.find( - (movie) => movie.releaseYear === year.toString() - ); + movie = contentResults.hits.find((movie) => movie.releaseYear === year); } // One last try, try exact name match only @@ -181,7 +178,7 @@ class RottenTomatoes extends ExternalAPI { if (year) { tvshow = contentResults.hits.find( - (series) => series.releaseYear === year.toString() + (series) => series.releaseYear === year ); } From 24d94ef6fd79d1fc1cef5464bbff5e6d2ba0789e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 11 Jun 2023 10:15:55 +0900 Subject: [PATCH 2/2] docs: add Fallenbagel as a contributor for code (#3493) [skip ci] * docs: update README.md * docs: update .all-contributorsrc --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 5ece548e..37187275 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -863,6 +863,15 @@ "contributions": [ "code" ] + }, + { + "login": "Fallenbagel", + "name": "Fallenbagel", + "avatar_url": "https://avatars.githubusercontent.com/u/98979876?v=4", + "profile": "https://github.com/Fallenbagel", + "contributions": [ + "code" + ] } ], "badgeTemplate": "\"All-orange.svg\"/>", diff --git a/README.md b/README.md index 522988c8..6fe73c27 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Translation status GitHub -All Contributors +All Contributors

@@ -195,6 +195,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Izaac Brånn
Izaac Brånn

💻 Salman Tariq
Salman Tariq

💻 Andrew Kennedy
Andrew Kennedy

💻 + Fallenbagel
Fallenbagel

💻