web/admin: only show plex servers you own

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-04 22:51:52 +02:00
parent e674f03064
commit b1c9126832
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ export interface PlexResource {
name: string;
provides: string;
clientIdentifier: string;
owned: boolean;
}
export const DEFAULT_HEADERS = {
@ -88,7 +89,7 @@ export class PlexAPIClient {
});
const resources: PlexResource[] = await resourcesResponse.json();
return resources.filter(r => {
return r.provides === "server";
return r.provides.toLowerCase().includes("server") && r.owned;
});
}