Skip to content

Commit 6437fae

Browse files
committed
fixed encodeURIComponent
1 parent b9668fb commit 6437fae

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
## 1.1.79
44

5-
- only pull ratings for visible elements, to reduce API calls
65
- fixed TMDB ratings not clickable on Prime Video
76
- fixed Disney Ratings in Britain
87

src/content-script/shared-functions.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ async function getMovieInfo(
223223
) {
224224
const locale = htmlLang || navigator?.language || "en-US"
225225
const queryType = media_type ?? "multi"
226-
let url = `https://api.themoviedb.org/3/search/${queryType}?query=${encodeURI(title)}&include_adult=false&language=${locale}&page=1`
226+
let url = `https://api.themoviedb.org/3/search/${queryType}?query=${encodeURIComponent(title)}&include_adult=false&language=${locale}&page=1`
227227
if (year) url += `&year=${year}`
228228
const data: TMDBResponse = await sendMessage("fetch", { url }, "background")
229229
if (data != undefined) {
@@ -352,15 +352,16 @@ function getAllTitleCardsTypes(): Array<NodeListOf<Element>> {
352352
return AllTitleCardsTypes
353353
}
354354
function isElementVisible(el: HTMLElement): boolean {
355-
if (!el) return false
356-
const rect = el.getBoundingClientRect()
357-
const visible =
358-
// el.checkVisibility({ checkOpacity: true, visibilityProperty: true, contentVisibilityAuto: true }) &&
359-
rect.bottom > 0 &&
360-
rect.right > 0 &&
361-
rect.top < (window.innerHeight || document.documentElement.clientHeight) &&
362-
rect.left < (window.innerWidth || document.documentElement.clientWidth)
363-
return visible
355+
return true
356+
// if (!el) return false
357+
// const rect = el.getBoundingClientRect()
358+
// const visible =
359+
// // el.checkVisibility({ checkOpacity: true, visibilityProperty: true, contentVisibilityAuto: true }) &&
360+
// rect.bottom > 0 &&
361+
// rect.right > 0 &&
362+
// rect.top < (window.innerHeight || document.documentElement.clientHeight) &&
363+
// rect.left < (window.innerWidth || document.documentElement.clientWidth)
364+
// return visible
364365
}
365366

366367
async function addRating(showRating: boolean, optionHideTitles: boolean) {

0 commit comments

Comments
 (0)