Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Shiba 2022-08-06 23:20:34 +00:00
commit 9084235cec
3 changed files with 6 additions and 3 deletions

View file

@ -18,7 +18,6 @@
"https://odysee.com/",
"https://madiator.com/",
"https://finder.madiator.com/",
"tabs",
"storage"
],
"web_accessible_resources": [

View file

@ -8,7 +8,6 @@
"128": "assets/icons/wol/icon128.png"
},
"permissions": [
"tabs",
"storage"
],
"host_permissions": [

View file

@ -47,7 +47,12 @@ export async function resolveById(params: Paramaters, progressCallback?: (progre
url.searchParams.set('video_ids', params.filter((item) => item.type === 'video').map((item) => item.id).join(','))
url.searchParams.set('channel_ids', params.filter((item) => item.type === 'channel').map((item) => item.id).join(','))
const apiResponse = await fetch(url.toString(), { cache: 'no-store' })
const controller = new AbortController()
// 5 second timeout:
const timeoutId = setTimeout(() => controller.abort(), 5000)
const apiResponse = await fetch(url.toString(), { cache: 'no-store', signal: controller.signal })
clearTimeout(timeoutId)
if (apiResponse.ok) {
const response: ApiResponse = await apiResponse.json()
for (const item of params) {