diff --git a/server/api/externalapi.ts b/server/api/externalapi.ts index e22fb4e0..70cd37b9 100644 --- a/server/api/externalapi.ts +++ b/server/api/externalapi.ts @@ -18,8 +18,8 @@ interface ExternalAPIOptions { class ExternalAPI { private baseUrl: string; - private params: Record; - private defaultHeaders: { [key: string]: string }; + protected params: Record; + protected defaultHeaders: { [key: string]: string }; private cache?: NodeCache; constructor( diff --git a/server/api/plextv.ts b/server/api/plextv.ts index 42faea1b..bd2d33fc 100644 --- a/server/api/plextv.ts +++ b/server/api/plextv.ts @@ -259,13 +259,15 @@ class PlexTvAPI extends ExternalAPI { items: PlexWatchlistItem[]; }> { try { - // const response = await this.get( const params = new URLSearchParams({ 'X-Plex-Container-Start': offset.toString(), 'X-Plex-Container-Size': size.toString(), }); const response = await fetch( - `https://metadata.provider.plex.tv/library/sections/watchlist/all?${params.toString()}` + `https://metadata.provider.plex.tv/library/sections/watchlist/all?${params.toString()}`, + { + headers: this.defaultHeaders, + } ); const data = (await response.json()) as WatchlistResponse;