Skip to content

Commit

Permalink
version 1.1.46
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Nov 5, 2024
1 parent e9809bb commit 762e6a0
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 19 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ See Statistics. All statistics and settings are not shared but are synchronized

## Ratings

Click on Rating to go to the TMDB page of the movie.

The ratings are gathered from the TMDB API. Ratings are refreshed every month.
If there is no score they are refreshed once per day. If the movie is newer than 50 days and has less than 100 votes it will get refreshed every 3 days.

Expand Down
2 changes: 1 addition & 1 deletion chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.1.45",
"version": "1.1.46",

"homepage_url": "https://github.com/Dreamlinerm/Netflix-Prime-Auto-Skip",
"icons": {
Expand Down
6 changes: 3 additions & 3 deletions chrome/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="color: grey; font-size: 1em">v.1.1.45</p>
<p style="color: grey; font-size: 1em">v.1.1.46</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down Expand Up @@ -215,7 +215,7 @@ <h2 data-i18n>SharedPageTitle</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<a href="https://www.themoviedb.org" target="_blank" class="line flex">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 489.04 35.4">
<defs>
<style>
Expand All @@ -237,7 +237,7 @@ <h2 data-i18n>SharedPageTitle</h2>
</g>
</g>
</svg>
</div>
</a>
</div>
<div class="hidden" id="AmazonSettings"
style="flex-direction: column; justify-content: space-between;flex-grow: 1;">
Expand Down
10 changes: 8 additions & 2 deletions chrome/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="font-size: 1em">v.1.1.45</p>
<p style="font-size: 1em">v.1.1.46</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down Expand Up @@ -735,7 +735,13 @@ <h2 data-i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.1.45</h2>
<h2>1.1.46</h2>
<ul>
<li>Linked TMDB website when click on rating</li>
</ul>
</div>
<div class="line flex">
<p>1.1.46</p>
<ul>
<li>Fix Disney bug: Remove "Continue watching after ad" text when ad is not running.</li>
</ul>
Expand Down
27 changes: 20 additions & 7 deletions chrome/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const isMobile = /mobile|streamingEnhanced/i.test(ua);
const isEdge = /edg/i.test(ua);
// const isFirefox = /firefox/i.test(ua);
// const isChrome = /chrome/i.test(ua);
const version = "1.1.45";
const version = "1.1.46";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO) {
/* eslint-env root:true */
// global variables in localStorage
Expand Down Expand Up @@ -268,6 +268,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
let compiledData = {};
const movie = data?.results?.[0];
compiledData = {
id: movie?.id,
media_type: movie?.media_type,
score: movie?.vote_average,
vote_count: movie?.vote_count,
release_date: movie?.release_date,
Expand Down Expand Up @@ -438,18 +440,27 @@ 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, "-")}`;
}

async function setRatingOnCard(card, data, title) {
let div = document.createElement("div");
let div = document.createElement(data?.id ? "a" : "div");
if (data?.id) {
div.href = getTMDBUrl(data.id, data.media_type, title);
div.target = "_blank";
}
const vote_count = data?.vote_count || 100;
// right: 1.5vw;
div.style =
"position: absolute;bottom: 0;right:0;z-index: 9999;color: black;background:" +
getColorForRating(data?.score, vote_count < 80) +
"position: absolute;bottom: 0;z-index: 9999;color: black;text-decoration: none;background:" +
getColorForRating(data?.score, vote_count < 50) +
";border-radius: 5px;padding: 0 2px 0 2px;" +
(isNetflix ? "right:0.2vw;" : "right:0;") +
(isMobile ? "font-size: 4vw;" : "font-size: 1vw;");

// div.id = "imdb";
if (data?.score && vote_count >= 80) {
if (data?.score && vote_count >= 50) {
div.textContent = data.score?.toFixed(1);
div.setAttribute("alt", data?.title + ", OG title: " + title + ", Vote count: " + vote_count);
} else if (data?.title) {
Expand All @@ -460,8 +471,10 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
div.setAttribute("alt", title);
log("no score found:", title, data);
}
if (isNetflix || isHBO) card.appendChild(div);
else if (isDisney) card?.querySelector("img").parentElement?.appendChild(div);
if (isNetflix) {
card.closest(".title-card-container")?.appendChild(div);
} else if (isHBO) card.appendChild(div);
else if (isDisney) card?.parentElement?.appendChild(div);
else if (isHotstar) card.parentElement.appendChild(div);
else if (isPrimeVideo) {
if (card.getAttribute("data-card-title")) card.firstChild.firstChild.appendChild(div);
Expand Down
2 changes: 1 addition & 1 deletion firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.1.45",
"version": "1.1.46",
"homepage_url": "https://github.com/Dreamlinerm/Netflix-Prime-Auto-Skip",
"icons": {
"16": "icons/NetflixAmazon Auto-Skip.svg",
Expand Down
2 changes: 1 addition & 1 deletion firefox/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="color: grey; font-size: 1em">v.1.1.45</p>
<p style="color: grey; font-size: 1em">v.1.1.46</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down
4 changes: 2 additions & 2 deletions firefox/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="font-size: 1em">v.1.1.45</p>
<p style="font-size: 1em">v.1.1.46</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down Expand Up @@ -741,7 +741,7 @@ <h2>1.1.46</h2>
</ul>
</div>
<div class="line flex">
<p>1.1.45</p>
<p>1.1.46</p>
<ul>
<li>Fix Disney bug: Remove "Continue watching after ad" text when ad is not running.</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const isMobile = /mobile|streamingEnhanced/i.test(ua);
const isEdge = /edg/i.test(ua);
// const isFirefox = /firefox/i.test(ua);
// const isChrome = /chrome/i.test(ua);
const version = "1.1.45";
const version = "1.1.46";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO) {
/* eslint-env root:true */
// global variables in localStorage
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "streaming-enhanced",
"version": "1.1.45",
"version": "1.1.46",
"description": "Automatically skip Ads, Intros, Credits and add Speed Control, etc. on Netflix, Prime video, Disney+ & Hotstar and Crunchyroll.",
"scripts": {
"start": "web-ext run --keep-profile-changes --firefox-profile=test --profile-create-if-missing",
Expand Down

0 comments on commit 762e6a0

Please sign in to comment.