Skip to content

Commit

Permalink
Netflix wrong TMDB ratings for movies with dash
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Nov 17, 2024
1 parent ad7fbd1 commit 685a1ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions firefox/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,12 @@ <h2 data-i18n>ImportSettings</h2>
<div id="ChangelogSettings" class="hidden">
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.1.51</h2>
<ul>
<li>Netflix wrong TMDB ratings for movies with dash</li>
</ul>
</div>
<div class="line flex">
<h2>1.1.50</h2>
<ul>
Expand Down
8 changes: 4 additions & 4 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
}
let title;

if (isNetflix) title = card?.parentElement?.getAttribute("aria-label").split(" ")[0];
if (isNetflix) title = card?.parentElement?.getAttribute("aria-label")?.split(" (")[0];
// S2: E3 remove this part
else if (isDisney) {
title = card?.getAttribute("aria-label")?.replace(" Disney+ Original", "")?.replace(" STAR Original", "");
Expand Down Expand Up @@ -509,14 +509,14 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (rating <= 7) return "rgb(245, 197, 24)"; //#f5c518
return "rgb(0, 166, 0)";
}
function getTMDBUrl(id, media_type, title) {
return `https://www.themoviedb.org/${media_type}/${id}-${title.toLowerCase().replace(/ /g, "-")}`;
function getTMDBUrl(id, media_type) {
return `https://www.themoviedb.org/${media_type}/${id}`;
}

async function setRatingOnCard(card, data, title) {
let div = document.createElement(data?.id ? "a" : "div");
if (data?.id) {
div.href = getTMDBUrl(data.id, data.media_type, title);
div.href = getTMDBUrl(data.id, data.media_type);
div.target = "_blank";
}
const vote_count = data?.vote_count || 100;
Expand Down

0 comments on commit 685a1ce

Please sign in to comment.