|
|
@ -1,7 +1,7 @@ |
|
|
|
import { IpcClientService } from "@autoplex/ipc"; |
|
|
|
import { Microservice } from "@autoplex/microservice"; |
|
|
|
import { SOCKET_PATH } from "./constants"; |
|
|
|
import { IMovieSearchInfo } from "./schema"; |
|
|
|
import { IMovieSearchInfo, ITorrentLink } from "./schema"; |
|
|
|
|
|
|
|
export class IpcClient<M extends Microservice = Microservice> extends IpcClientService<M> |
|
|
|
{ |
|
|
@ -17,16 +17,16 @@ export class IpcClient<M extends Microservice = Microservice> extends IpcClientS |
|
|
|
|
|
|
|
/** |
|
|
|
* Add a torrent to the client |
|
|
|
* @param torrent Magnet URI or file buffer |
|
|
|
*/ |
|
|
|
public async searchMovie(title: string, imdbId?: string, year?: number, altTitles: string[] = []) |
|
|
|
public async searchMovie(title: string, imdbId: string|null, year: number|null, |
|
|
|
altTitles: string[] = [], torrentBlacklist: string[] = []) |
|
|
|
{ |
|
|
|
let response = await this.request("search_movie", <IMovieSearchInfo> { |
|
|
|
title, imdbId, year, altTitles |
|
|
|
title, imdbId, year, altTitles, torrentBlacklist |
|
|
|
}); |
|
|
|
if (response.error) { |
|
|
|
throw new Error("Failed to search for movie torrent"); |
|
|
|
} |
|
|
|
return <string>response.data; |
|
|
|
return <ITorrentLink|null>response.data; |
|
|
|
} |
|
|
|
} |