diff --git a/package.json b/package.json index 93be9924..632388a1 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@sozialhelden/ietf-language-tags": "^5.4.2", "@types/node-forge": "^1.3.11", "classnames": "^2.5.1", - "core-js": "^3.36.1", + "core-js": "^3.37.0", "detect-browser": "^5.3.0", "dompurify": "^3.1.0", "flag-icons": "^7.2.1", @@ -87,7 +87,7 @@ "@types/react": "^18.2.79", "@types/react-dom": "^18.2.25", "@types/react-helmet": "^6.1.11", - "@types/react-lazy-load-image-component": "^1.6.3", + "@types/react-lazy-load-image-component": "^1.6.4", "@types/react-router": "^5.1.20", "@types/react-router-dom": "^5.3.3", "@types/react-stickynode": "^4.0.3", @@ -121,7 +121,7 @@ "tailwindcss-themer": "^4.0.0", "type-fest": "^4.15.0", "typescript": "^5.4.5", - "vite": "^5.2.8", + "vite": "^5.2.9", "vite-plugin-checker": "^0.6.4", "vite-plugin-package-version": "^1.1.0", "vite-plugin-pwa": "^0.17.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2163a51a..c6facd42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,8 +46,8 @@ dependencies: specifier: ^2.5.1 version: 2.5.1 core-js: - specifier: ^3.36.1 - version: 3.36.1 + specifier: ^3.37.0 + version: 3.37.0 detect-browser: specifier: ^5.3.0 version: 5.3.0 @@ -192,8 +192,8 @@ devDependencies: specifier: ^6.1.11 version: 6.1.11 '@types/react-lazy-load-image-component': - specifier: ^1.6.3 - version: 1.6.3 + specifier: ^1.6.4 + version: 1.6.4 '@types/react-router': specifier: ^5.1.20 version: 5.1.20 @@ -217,7 +217,7 @@ devDependencies: version: 6.21.0(eslint@8.57.0)(typescript@5.4.5) '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.2.1(vite@5.2.8) + version: 4.2.1(vite@5.2.9) autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.38) @@ -294,20 +294,20 @@ devDependencies: specifier: ^5.4.5 version: 5.4.5 vite: - specifier: ^5.2.8 - version: 5.2.8(@types/node@20.12.7) + specifier: ^5.2.9 + version: 5.2.9(@types/node@20.12.7) vite-plugin-checker: specifier: ^0.6.4 - version: 0.6.4(eslint@8.57.0)(typescript@5.4.5)(vite@5.2.8) + version: 0.6.4(eslint@8.57.0)(typescript@5.4.5)(vite@5.2.9) vite-plugin-package-version: specifier: ^1.1.0 - version: 1.1.0(vite@5.2.8) + version: 1.1.0(vite@5.2.9) vite-plugin-pwa: specifier: ^0.17.5 - version: 0.17.5(vite@5.2.8)(workbox-build@7.0.0)(workbox-window@7.0.0) + version: 0.17.5(vite@5.2.9)(workbox-build@7.0.0)(workbox-window@7.0.0) vite-plugin-static-copy: specifier: ^1.0.2 - version: 1.0.2(vite@5.2.8) + version: 1.0.2(vite@5.2.9) vitest: specifier: ^1.5.0 version: 1.5.0(@types/node@20.12.7)(jsdom@23.2.0) @@ -1499,7 +1499,7 @@ packages: babel-plugin-polyfill-corejs2: 0.4.10(@babel/core@7.24.4) babel-plugin-polyfill-corejs3: 0.10.4(@babel/core@7.24.4) babel-plugin-polyfill-regenerator: 0.6.1(@babel/core@7.24.4) - core-js-compat: 3.36.1 + core-js-compat: 3.37.0 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -2267,8 +2267,8 @@ packages: '@types/react': 18.2.79 dev: true - /@types/react-lazy-load-image-component@1.6.3: - resolution: {integrity: sha512-HsIsYz7yWWTh/bftdzGnijKD26JyofLRqM/RM80sxs7Gk13G83ew8R/ra2XzXuiZfjNEjAq/Va+NBHFF9ciwxA==} + /@types/react-lazy-load-image-component@1.6.4: + resolution: {integrity: sha512-8pFPeDPF4yVG4lU1/ixZidJEEDZmEOYOTYDvmIu2IAabyuv97Q7n/93nMCocHvQ7vD1czKGiW+op55D9m3MkdA==} dependencies: '@types/react': 18.2.79 csstype: 3.1.3 @@ -2457,7 +2457,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-react@4.2.1(vite@5.2.8): + /@vitejs/plugin-react@4.2.1(vite@5.2.9): resolution: {integrity: sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -2468,7 +2468,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.4) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.2.8(@types/node@20.12.7) + vite: 5.2.9(@types/node@20.12.7) transitivePeerDependencies: - supports-color dev: true @@ -2492,7 +2492,7 @@ packages: /@vitest/snapshot@1.5.0: resolution: {integrity: sha512-qpv3fSEuNrhAO3FpH6YYRdaECnnRjg9VxbhdtPwPRnzSfHVXnNzzrpX4cJxqiwgRMo7uRMWDFBlsBq4Cr+rO3A==} dependencies: - magic-string: 0.30.9 + magic-string: 0.30.10 pathe: 1.1.2 pretty-format: 29.7.0 dev: true @@ -2781,7 +2781,7 @@ packages: dependencies: '@babel/core': 7.24.4 '@babel/helper-define-polyfill-provider': 0.6.1(@babel/core@7.24.4) - core-js-compat: 3.36.1 + core-js-compat: 3.37.0 transitivePeerDependencies: - supports-color dev: true @@ -2840,7 +2840,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001610 - electron-to-chromium: 1.4.736 + electron-to-chromium: 1.4.738 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.23.0) @@ -3053,14 +3053,14 @@ packages: toggle-selection: 1.0.6 dev: false - /core-js-compat@3.36.1: - resolution: {integrity: sha512-Dk997v9ZCt3X/npqzyGdTlq6t7lDBhZwGvV94PKzDArjp7BTRm7WlDAXYd/OWdeFHO8OChQYRJNJvUCqCbrtKA==} + /core-js-compat@3.37.0: + resolution: {integrity: sha512-vYq4L+T8aS5UuFg4UwDhc7YNRWVeVZwltad9C/jV3R2LgVOpS9BDr7l/WL6BN0dbV3k1XejPTHqqEzJgsa0frA==} dependencies: browserslist: 4.23.0 dev: true - /core-js@3.36.1: - resolution: {integrity: sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA==} + /core-js@3.37.0: + resolution: {integrity: sha512-fu5vHevQ8ZG4og+LXug8ulUtVxjOcEYvifJr7L5Bfq9GOztVqsKd9/59hUk2ZSbCrS3BqUr3EpaYGIYzq7g3Ug==} requiresBuild: true dev: false @@ -3346,8 +3346,8 @@ packages: jake: 10.8.7 dev: true - /electron-to-chromium@1.4.736: - resolution: {integrity: sha512-Rer6wc3ynLelKNM4lOCg7/zPQj8tPOCB2hzD32PX9wd3hgRRi9MxEbmkFCokzcEhRVMiOVLjnL9ig9cefJ+6+Q==} + /electron-to-chromium@1.4.738: + resolution: {integrity: sha512-lwKft2CLFztD+vEIpesrOtCrko/TFnEJlHFdRhazU7Y/jx5qc4cqsocfVrBg4So4gGe9lvxnbLIoev47WMpg+A==} /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -4930,9 +4930,8 @@ packages: sourcemap-codec: 1.4.8 dev: true - /magic-string@0.30.9: - resolution: {integrity: sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==} - engines: {node: '>=12'} + /magic-string@0.30.10: + resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 dev: true @@ -6742,7 +6741,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.2.8(@types/node@20.12.7) + vite: 5.2.9(@types/node@20.12.7) transitivePeerDependencies: - '@types/node' - less @@ -6754,7 +6753,7 @@ packages: - terser dev: true - /vite-plugin-checker@0.6.4(eslint@8.57.0)(typescript@5.4.5)(vite@5.2.8): + /vite-plugin-checker@0.6.4(eslint@8.57.0)(typescript@5.4.5)(vite@5.2.9): resolution: {integrity: sha512-2zKHH5oxr+ye43nReRbC2fny1nyARwhxdm0uNYp/ERy4YvU9iZpNOsueoi/luXw5gnpqRSvjcEPxXbS153O2wA==} engines: {node: '>=14.16'} peerDependencies: @@ -6798,22 +6797,22 @@ packages: strip-ansi: 6.0.1 tiny-invariant: 1.3.3 typescript: 5.4.5 - vite: 5.2.8(@types/node@20.12.7) + vite: 5.2.9(@types/node@20.12.7) vscode-languageclient: 7.0.0 vscode-languageserver: 7.0.0 vscode-languageserver-textdocument: 1.0.11 vscode-uri: 3.0.8 dev: true - /vite-plugin-package-version@1.1.0(vite@5.2.8): + /vite-plugin-package-version@1.1.0(vite@5.2.9): resolution: {integrity: sha512-TPoFZXNanzcaKCIrC3e2L/TVRkkRLB6l4RPN/S7KbG7rWfyLcCEGsnXvxn6qR7fyZwXalnnSN/I9d6pSFjHpEA==} peerDependencies: vite: '>=2.0.0-beta.69' dependencies: - vite: 5.2.8(@types/node@20.12.7) + vite: 5.2.9(@types/node@20.12.7) dev: true - /vite-plugin-pwa@0.17.5(vite@5.2.8)(workbox-build@7.0.0)(workbox-window@7.0.0): + /vite-plugin-pwa@0.17.5(vite@5.2.9)(workbox-build@7.0.0)(workbox-window@7.0.0): resolution: {integrity: sha512-UxRNPiJBzh4tqU/vc8G2TxmrUTzT6BqvSzhszLk62uKsf+npXdvLxGDz9C675f4BJi6MbD2tPnJhi5txlMzxbQ==} engines: {node: '>=16.0.0'} peerDependencies: @@ -6824,14 +6823,14 @@ packages: debug: 4.3.4 fast-glob: 3.3.2 pretty-bytes: 6.1.1 - vite: 5.2.8(@types/node@20.12.7) + vite: 5.2.9(@types/node@20.12.7) workbox-build: 7.0.0 workbox-window: 7.0.0 transitivePeerDependencies: - supports-color dev: true - /vite-plugin-static-copy@1.0.2(vite@5.2.8): + /vite-plugin-static-copy@1.0.2(vite@5.2.9): resolution: {integrity: sha512-AfmEF+a/mfjsUsrgjbCkhzUCeIUF4EKQXXt3Ie1cour9MBpy6f6GphbdW2td28oYfOrwCyRzFCksgLkpk58q6Q==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: @@ -6841,11 +6840,11 @@ packages: fast-glob: 3.3.2 fs-extra: 11.2.0 picocolors: 1.0.0 - vite: 5.2.8(@types/node@20.12.7) + vite: 5.2.9(@types/node@20.12.7) dev: true - /vite@5.2.8(@types/node@20.12.7): - resolution: {integrity: sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA==} + /vite@5.2.9(@types/node@20.12.7): + resolution: {integrity: sha512-uOQWfuZBlc6Y3W/DTuQ1Sr+oIXWvqljLvS881SVmAj00d5RdgShLcuXWxseWPd4HXwiYBFW/vXHfKFeqj9uQnw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -6917,14 +6916,14 @@ packages: execa: 8.0.1 jsdom: 23.2.0 local-pkg: 0.5.0 - magic-string: 0.30.9 + magic-string: 0.30.10 pathe: 1.1.2 picocolors: 1.0.0 std-env: 3.7.0 strip-literal: 2.1.0 tinybench: 2.7.0 tinypool: 0.8.4 - vite: 5.2.8(@types/node@20.12.7) + vite: 5.2.9(@types/node@20.12.7) vite-node: 1.5.0(@types/node@20.12.7) why-is-node-running: 2.2.2 transitivePeerDependencies: diff --git a/src/backend/metadata/tmdb.ts b/src/backend/metadata/tmdb.ts index 8b07f111..28c716d9 100644 --- a/src/backend/metadata/tmdb.ts +++ b/src/backend/metadata/tmdb.ts @@ -153,6 +153,12 @@ const tmdbHeaders = { Authorization: `Bearer ${apiKey}`, }; +function abortOnTimeout(timeout: number): AbortSignal { + const controller = new AbortController(); + setTimeout(() => controller.abort(), timeout); + return controller.signal; +} + export async function get(url: string, params?: object): Promise { if (!apiKey) throw new Error("TMDB API key not set"); try { @@ -162,7 +168,7 @@ export async function get(url: string, params?: object): Promise { params: { ...params, }, - signal: AbortSignal.timeout(5000), + signal: abortOnTimeout(5000), }); } catch (err) { return mwFetch(encodeURI(url), { @@ -171,7 +177,7 @@ export async function get(url: string, params?: object): Promise { params: { ...params, }, - signal: AbortSignal.timeout(30000), + signal: abortOnTimeout(30000), }); } }