Files
sugarr/src/app/clients/radarr/endpoints/LookupEndpoint.ts
2026-08-12 21:05:58 +02:00

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