diff --git a/releases/latest_chrome.zip b/releases/latest_chrome.zip index 6c39434..fb0ade4 100644 Binary files a/releases/latest_chrome.zip and b/releases/latest_chrome.zip differ diff --git a/releases/latest_firefox.xpi b/releases/latest_firefox.xpi index 7d60814..2d87eb3 100644 Binary files a/releases/latest_firefox.xpi and b/releases/latest_firefox.xpi differ diff --git a/src/dom/providers/Netflix.ts b/src/dom/providers/Netflix.ts index bcff8da..de3a1f0 100644 --- a/src/dom/providers/Netflix.ts +++ b/src/dom/providers/Netflix.ts @@ -60,14 +60,26 @@ export default class Netflix extends Manager { browserExtensionProducts: BrowserExtensionProduct[] ): Promise { // Response from API with all browserExtensionProducts - browserExtensionProducts.forEach((browserExtensionProduct) => { + for (const browserExtensionProduct of browserExtensionProducts) { const hash = md5(browserExtensionProduct.platformId.toString()) + const videoInfo = { + name: name, + redirect: await generateRedirectUrl(name), + id: '', + url: browserExtensionProduct.url, + type: browserExtensionProduct.type, + rating: browserExtensionProduct?.rating?.toString(), + hash, + platformId: browserExtensionProduct?.platformId, + } + + this.cache.save(videoInfo) const platformId = browserExtensionProduct.platformId const cardElements = document.querySelectorAll( `.title-card a[href*="/watch/${platformId}"]` ) - cardElements.forEach(async (cardElement) => { + for (const cardElement of cardElements) { const videoName = cardElement?.getAttribute('aria-label') const hashClass = 'senscritique_' + hash if (!cardElement.querySelector(`.${hashClass}`)) { @@ -91,8 +103,8 @@ export default class Netflix extends Manager { platformId: browserExtensionProduct?.platformId, }) } - }) - }) + } + } } refreshModalRating(): void { diff --git a/src/dom/providers/PrimeVideo.ts b/src/dom/providers/PrimeVideo.ts index 6736951..ada263b 100644 --- a/src/dom/providers/PrimeVideo.ts +++ b/src/dom/providers/PrimeVideo.ts @@ -119,7 +119,7 @@ export default class PrimeVideo extends Manager { ...legacyElements, ] - cardElements.forEach(async (cardElement: HTMLElement) => { + for (const cardElement of cardElements) { // Only keep carousel and wall elements (without episode URL) if ( cardElement.getAttribute('href')?.match(`/detail/${platformId}.*`) || @@ -135,7 +135,7 @@ export default class PrimeVideo extends Manager { ) { const hashClass = 'senscritique_' + hash if (!cardElement.querySelector(`.${hashClass}`)) { - let name = cardElement.innerText + let name = (cardElement as HTMLElement).innerText const mainDiv = document.createElement('div') mainDiv.style.position = 'absolute' mainDiv.style.zIndex = '2' @@ -162,7 +162,7 @@ export default class PrimeVideo extends Manager { }) } } - }) + } }) }