fix: add missing auth token in Plex request
This commit is contained in:
@@ -18,8 +18,8 @@ interface ExternalAPIOptions {
|
||||
|
||||
class ExternalAPI {
|
||||
private baseUrl: string;
|
||||
private params: Record<string, string>;
|
||||
private defaultHeaders: { [key: string]: string };
|
||||
protected params: Record<string, string>;
|
||||
protected defaultHeaders: { [key: string]: string };
|
||||
private cache?: NodeCache;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -259,13 +259,15 @@ class PlexTvAPI extends ExternalAPI {
|
||||
items: PlexWatchlistItem[];
|
||||
}> {
|
||||
try {
|
||||
// const response = await this.get<WatchlistResponse>(
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user