diff --git a/api/torrent-search/src/IpcClient.ts b/api/torrent-search/src/IpcClient.ts index 35b0026..9dd4d8e 100644 --- a/api/torrent-search/src/IpcClient.ts +++ b/api/torrent-search/src/IpcClient.ts @@ -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 extends IpcClientService { @@ -17,16 +17,16 @@ export class IpcClient 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", { - title, imdbId, year, altTitles + title, imdbId, year, altTitles, torrentBlacklist }); if (response.error) { throw new Error("Failed to search for movie torrent"); } - return response.data; + return response.data; } } diff --git a/api/torrent-search/src/schema.ts b/api/torrent-search/src/schema.ts index b9ea263..a3c844c 100644 --- a/api/torrent-search/src/schema.ts +++ b/api/torrent-search/src/schema.ts @@ -4,8 +4,8 @@ export interface IMovieSearchInfo { title : string, altTitles : string[], - imdbId? : string, - year? : number, + imdbId : string|null, + year : number|null, torrentBlacklist: string[] } diff --git a/services/torrent-search/src/torrents/providers/torrentgalaxy/index.ts b/services/torrent-search/src/torrents/providers/torrentgalaxy/index.ts index e6bd20d..7d7d81d 100644 --- a/services/torrent-search/src/torrents/providers/torrentgalaxy/index.ts +++ b/services/torrent-search/src/torrents/providers/torrentgalaxy/index.ts @@ -19,7 +19,7 @@ export default class TorrentGalaxy extends Provider * Search for a movie */ public async searchMovie(movie: IMovieSearchInfo) { - if (movie.imdbId === undefined) { + if (movie.imdbId === null) { return []; } await this.lock();