Browse Source

Add interface method to Plex API to grab links for given movie items

dev
David Ludwig 4 years ago
parent
commit
db2306cc91
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      api/plex/src/IpcClient.ts

+ 11
- 0
api/plex/src/IpcClient.ts View File

@ -13,4 +13,15 @@ export class IpcClient<M extends Microservice = Microservice> extends IpcClientS
* The path to the socket file
*/
protected readonly SOCKET_PATH = SOCKET_PATH;
/**
* 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;
}
}

Loading…
Cancel
Save