Skip to content

Commit 23dca33

Browse files
committed
reduce API calls
1 parent 4b3f586 commit 23dca33

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.1.79
4+
5+
- only pull ratings for visible elements, to reduce API calls
6+
37
## 1.1.78
48

59
- Crunchyroll: fixed Release calendar filtering for dub incorrectly

src/content-script/shared-functions.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,14 @@ async function addRating(showRating: boolean, optionHideTitles: boolean) {
411411
useDBCache(title, card, media_type)
412412
}
413413
// if element is not visible skip it
414-
// else if (!isElementVisible(card)) {
415-
// if (isNetflix || isDisney || isHotstar || isHBO || isParamount) card.classList.remove("imdb")
416-
// else if (isPrimeVideo) {
417-
// if (type == 0) card?.closest("li")?.classList.remove("imdb")
418-
// else if (type == 1) card?.classList.remove("imdb")
419-
// }
420-
// continue
421-
// }
422-
else {
414+
else if (!isElementVisible(card)) {
415+
if (isNetflix || isDisney || isHotstar || isHBO || isParamount) card.classList.remove("imdb")
416+
else if (isPrimeVideo) {
417+
if (type == 0) card?.closest("li")?.classList.remove("imdb")
418+
else if (type == 1) card?.classList.remove("imdb")
419+
}
420+
continue
421+
} else {
423422
getMovieInfo(title, card, media_type)
424423
updateDBCache = true
425424
}

0 commit comments

Comments
 (0)