|
|
@ -42,7 +42,10 @@ sonarrRoutes.post('/test', async (req, res, next) => {
|
|
|
|
url: SonarrAPI.buildUrl(req.body, '/api/v3'),
|
|
|
|
url: SonarrAPI.buildUrl(req.body, '/api/v3'),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const { urlBase } = await sonarr.getSystemStatus();
|
|
|
|
const urlBase = await sonarr
|
|
|
|
|
|
|
|
.getSystemStatus()
|
|
|
|
|
|
|
|
.then((value) => value.urlBase)
|
|
|
|
|
|
|
|
.catch(() => req.body.baseUrl);
|
|
|
|
const profiles = await sonarr.getProfiles();
|
|
|
|
const profiles = await sonarr.getProfiles();
|
|
|
|
const folders = await sonarr.getRootFolders();
|
|
|
|
const folders = await sonarr.getRootFolders();
|
|
|
|
const languageProfiles = await sonarr.getLanguageProfiles();
|
|
|
|
const languageProfiles = await sonarr.getLanguageProfiles();
|
|
|
@ -56,10 +59,7 @@ sonarrRoutes.post('/test', async (req, res, next) => {
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
languageProfiles,
|
|
|
|
languageProfiles,
|
|
|
|
tags,
|
|
|
|
tags,
|
|
|
|
urlBase:
|
|
|
|
urlBase,
|
|
|
|
req.body.baseUrl && req.body.baseUrl !== '/'
|
|
|
|
|
|
|
|
? req.body.baseUrl
|
|
|
|
|
|
|
|
: urlBase,
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
logger.error('Failed to test Sonarr', {
|
|
|
|
logger.error('Failed to test Sonarr', {
|
|
|
|