Browse Source

Update Plex IPC interface to match the new IPC package

dev
David Ludwig 4 years ago
parent
commit
939ee8f32e
1 changed files with 2 additions and 10 deletions
  1. +2
    -10
      api/plex/src/IpcClient.ts

+ 2
- 10
api/plex/src/IpcClient.ts View File

@ -18,21 +18,13 @@ export class IpcClient<M extends Microservice = Microservice> 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);
}
}

Loading…
Cancel
Save