fix(services): update all radarr/sonarr endpoints to use v3

pull/1001/head
sct 4 years ago
parent 0acad8e9fa
commit da5ca02f81

@ -242,7 +242,7 @@ class RadarrAPI extends ExternalAPI {
public getProfiles = async (): Promise<RadarrProfile[]> => {
try {
const data = await this.getRolling<RadarrProfile[]>(
`/profile`,
`/qualityProfile`,
undefined,
3600
);

@ -291,7 +291,7 @@ class SonarrAPI extends ExternalAPI {
public async getProfiles(): Promise<SonarrProfile[]> {
try {
const data = await this.getRolling<SonarrProfile[]>(
'/profile',
'/qualityProfile',
undefined,
3600
);
@ -331,7 +331,7 @@ class SonarrAPI extends ExternalAPI {
public async getLanguageProfiles(): Promise<LanguageProfile[]> {
try {
const data = await this.getRolling<LanguageProfile[]>(
'/v3/languageprofile',
'/languageprofile',
undefined,
3600
);

@ -387,9 +387,7 @@ export class MediaRequest {
const tmdb = new TheMovieDb();
const radarr = new RadarrAPI({
apiKey: radarrSettings.apiKey,
url: `${radarrSettings.useSsl ? 'https' : 'http'}://${
radarrSettings.hostname
}:${radarrSettings.port}${radarrSettings.baseUrl ?? ''}/api`,
url: RadarrAPI.buildRadarrUrl(radarrSettings, '/api/v3'),
});
const movie = await tmdb.getMovie({ movieId: this.media.tmdbId });
@ -535,9 +533,7 @@ export class MediaRequest {
const tmdb = new TheMovieDb();
const sonarr = new SonarrAPI({
apiKey: sonarrSettings.apiKey,
url: `${sonarrSettings.useSsl ? 'https' : 'http'}://${
sonarrSettings.hostname
}:${sonarrSettings.port}${sonarrSettings.baseUrl ?? ''}/api`,
url: SonarrAPI.buildSonarrUrl(sonarrSettings, '/api/v3'),
});
const series = await tmdb.getTvShow({ tvId: media.tmdbId });
const tvdbId = series.external_ids.tvdb_id ?? media.tvdbId;

@ -46,9 +46,7 @@ serviceRoutes.get<{ radarrId: string }>(
const radarr = new RadarrAPI({
apiKey: radarrSettings.apiKey,
url: `${radarrSettings.useSsl ? 'https' : 'http'}://${
radarrSettings.hostname
}:${radarrSettings.port}${radarrSettings.baseUrl ?? ''}/api`,
url: RadarrAPI.buildRadarrUrl(radarrSettings, '/api/v3'),
});
const profiles = await radarr.getProfiles();
@ -116,9 +114,7 @@ serviceRoutes.get<{ sonarrId: string }>(
const sonarr = new SonarrAPI({
apiKey: sonarrSettings.apiKey,
url: `${sonarrSettings.useSsl ? 'https' : 'http'}://${
sonarrSettings.hostname
}:${sonarrSettings.port}${sonarrSettings.baseUrl ?? ''}/api`,
url: SonarrAPI.buildSonarrUrl(sonarrSettings, '/api/v3'),
});
try {

@ -39,9 +39,7 @@ radarrRoutes.post('/test', async (req, res, next) => {
try {
const radarr = new RadarrAPI({
apiKey: req.body.apiKey,
url: `${req.body.useSsl ? 'https' : 'http'}://${req.body.hostname}:${
req.body.port
}${req.body.baseUrl ?? ''}/api`,
url: RadarrAPI.buildRadarrUrl(req.body, '/api/v3'),
});
const profiles = await radarr.getProfiles();
@ -112,9 +110,7 @@ radarrRoutes.get<{ id: string }>('/:id/profiles', async (req, res) => {
const radarr = new RadarrAPI({
apiKey: radarrSettings.apiKey,
url: `${radarrSettings.useSsl ? 'https' : 'http'}://${
radarrSettings.hostname
}:${radarrSettings.port}${radarrSettings.baseUrl ?? ''}/api`,
url: RadarrAPI.buildRadarrUrl(radarrSettings, '/api/v3'),
});
const profiles = await radarr.getProfiles();

@ -39,9 +39,7 @@ sonarrRoutes.post('/test', async (req, res, next) => {
try {
const sonarr = new SonarrAPI({
apiKey: req.body.apiKey,
url: `${req.body.useSsl ? 'https' : 'http'}://${req.body.hostname}:${
req.body.port
}${req.body.baseUrl ?? ''}/api`,
url: SonarrAPI.buildSonarrUrl(req.body, '/api/v3'),
});
const profiles = await sonarr.getProfiles();

Loading…
Cancel
Save