|
|
@ -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); |
|
|
|
} |
|
|
|
} |