Skip to content

Commit

Permalink
removed addStreamLinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 26, 2023
1 parent 89538c6 commit 3a53c28
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions firefox/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ <h2 id="openAmazonSettings" i18n>PageSpecificTitle;Prime Video</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<!-- <div class="line flex">
<p i18n>StreamLinksSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonStreamLinks" />
<span class="slider round"></span>
</label>
</div>
</div> -->
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions firefox/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,14 @@ <h2 i18n>PageSpecificTitle;Prime Video</h2>
<p class="description" i18n>PaidContentDescription</p>
<hr />

<div class="line flex">
<!-- <div class="line flex">
<p i18n>StreamLinksSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonStreamLinks" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>StreamLinksDescription</p>
<p class="description" i18n>StreamLinksDescription</p> -->

<!-- <h2 i18n>sharedSettings</h2>
<p class="description" i18n>sharedSettingsDescription;Prime Video</p>
Expand Down
22 changes: 12 additions & 10 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
}
if (isNetflix) {
if (settings.Netflix?.showRating) startShowRatingInterval();
} else if (isPrimeVideo) {
if (settings.Amazon?.streamLinks) addStreamLinks();
} else if (isDisney || isHotstar) {
}
// else if (isPrimeVideo) {
// if (settings.Amazon?.streamLinks) addStreamLinks();
// }
else if (isDisney || isHotstar) {
// startShowRatingInterval();
}
});
Expand Down Expand Up @@ -156,7 +158,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
if (oldValue === undefined || newValue.Amazon.blockFreevee !== oldValue.Amazon?.blockFreevee) startAmazonBlockFreeveeObserver();
if (oldValue === undefined || newValue.Amazon.speedSlider !== oldValue.Amazon?.speedSlider) startAmazonSpeedSliderObserver();
if (oldValue === undefined || newValue.Amazon.filterPaid !== oldValue.Amazon?.filterPaid) startAmazonFilterPaidObserver();
if (oldValue === undefined || newValue.Video.streamLinks !== oldValue.Amazon?.streamLinks) addStreamLinks();
// if (oldValue === undefined || newValue.Video.streamLinks !== oldValue.Amazon?.streamLinks) addStreamLinks();

// if (oldValue === undefined || newValue.Video.showRating !== oldValue.Amazon?.showRating) startShowRatingInterval();
} else if (isDisney || isHotstar) {
Expand Down Expand Up @@ -250,7 +252,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
const config = { attributes: true, childList: true, subtree: true };

// shared functions
async function JustWatch() {
async function addRating() {
let titleCards;
if (isNetflix) titleCards = document.querySelectorAll(".title-card .boxart-container:not(.imdb)");
else if (isDisney) titleCards = document.querySelectorAll(".basic-card div div img:not(.imdb)");
Expand Down Expand Up @@ -954,7 +956,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
removeEventListener("fullscreenchange", OnFullScreenChange);
}
}

// deprecated
async function addStreamLinks() {
console.log("adding stream links");
let title = document.querySelector("h1[data-automation-id='title']")?.textContent?.split(" [")[0];
Expand All @@ -974,13 +976,13 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
async function startShowRatingInterval() {
if (settings.Netflix?.showRating) {
log("started observing| ShowRating");
JustWatch();
let JustWatchInterval = setInterval(function () {
addRating();
let RatingInterval = setInterval(function () {
if (!settings.Netflix?.showRating) {
clearInterval(JustWatchInterval);
clearInterval(RatingInterval);
log("stopped observing| ShowRating");
} else {
JustWatch();
addRating();
}
}, 1000);
let DBCacheInterval = setInterval(function () {
Expand Down

0 comments on commit 3a53c28

Please sign in to comment.