From 939ee8f32e21b8da7137f6b7e03fc954613173eb Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Thu, 24 Jun 2021 15:53:17 -0500 Subject: [PATCH] Update Plex IPC interface to match the new IPC package --- api/plex/src/IpcClient.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/api/plex/src/IpcClient.ts b/api/plex/src/IpcClient.ts index 5f01d20..aab8d81 100644 --- a/api/plex/src/IpcClient.ts +++ b/api/plex/src/IpcClient.ts @@ -18,21 +18,13 @@ export class IpcClient extends IpcClientS * Fetch a Plex movie link given the TMDb ID if it exists */ public async movieLinks(tmdbIds: (number|string)[]) { - let results = await this.request("movie_links", tmdbIds); - if (results.error) { - throw new Error("Failed to fetch Plex movie link"); - } - return <{ [tmdbId: string]: string|null }>results.data; + return await this.request<{ [tmdbId: number]: string|null }>("movie_links", tmdbIds); } /** * Check if the given movie is already on Plex */ public async hasMovie(tmdbId: number|string) { - let results = await this.request("has_movie", tmdbId); - if (results.error) { - throw new Error("Failed to check if Plex has a movie"); - } - return results.data; + return await this.request("has_movie", tmdbId); } }