mirror of
https://github.com/FJurmanovic/sugarr.git
synced 2026-11-11 07:41:08 +00:00
33 lines
774 B
TypeScript
33 lines
774 B
TypeScript
import { Endpoint, type HttpMethod } from '../../../../core/http/Endpoint';
|
|
|
|
export interface RadarrMovie {
|
|
title: string;
|
|
tmdbId: number;
|
|
qualityProfileId: number;
|
|
rootFolderPath: string;
|
|
monitored: boolean;
|
|
addOptions: { searchForMovie: boolean };
|
|
}
|
|
|
|
interface RadarrLookupResult {
|
|
title: string;
|
|
tmdbId: number;
|
|
}
|
|
|
|
export interface LookupParams {
|
|
tmdbId: number;
|
|
}
|
|
|
|
export class LookupEndpoint extends Endpoint<RadarrLookupResult, LookupParams> {
|
|
readonly method: HttpMethod = 'GET';
|
|
path(): string {
|
|
return '/api/v3/movie/lookup/tmdb';
|
|
}
|
|
query(params: LookupParams): Record<string, string> {
|
|
return { tmdbId: String(params.tmdbId) };
|
|
}
|
|
parseResponse(json: unknown): RadarrLookupResult {
|
|
return json as RadarrLookupResult;
|
|
}
|
|
}
|