diff --git a/src/backend/metadata/tmdb.ts b/src/backend/metadata/tmdb.ts index f9d21c6c..2e675f10 100644 --- a/src/backend/metadata/tmdb.ts +++ b/src/backend/metadata/tmdb.ts @@ -156,10 +156,10 @@ const headers = { async function get(url: string, params?: object): Promise { if (!apiKey) throw new Error("TMDB API key not set"); - let res: Promise; + let res: T; try { - res = await mwFetch(encodeURI(url), { + res = await mwFetch(encodeURI(url), { headers, baseURL, params: { @@ -170,7 +170,7 @@ async function get(url: string, params?: object): Promise { } catch (err) { if (baseURL !== otherUrl) { baseURL = otherUrl; - res = await mwFetch(encodeURI(url), { + res = await mwFetch(encodeURI(url), { headers, baseURL, params: {