|
|
|
@ -126,7 +126,7 @@ class SonarrAPI {
|
|
|
|
|
|
|
|
|
|
series.addOptions = {
|
|
|
|
|
ignoreEpisodesWithFiles: true,
|
|
|
|
|
searchForMissingEpisodes: true,
|
|
|
|
|
searchForMissingEpisodes: options.searchNow,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const newSeriesResponse = await this.axios.put<SonarrSeries>(
|
|
|
|
@ -134,6 +134,21 @@ class SonarrAPI {
|
|
|
|
|
series
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (newSeriesResponse.data.id) {
|
|
|
|
|
logger.info('Sonarr accepted request. Updated existing series', {
|
|
|
|
|
label: 'Sonarr',
|
|
|
|
|
});
|
|
|
|
|
logger.debug('Sonarr add details', {
|
|
|
|
|
label: 'Sonarr',
|
|
|
|
|
movie: newSeriesResponse.data,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
logger.error('Failed to add movie to Sonarr', {
|
|
|
|
|
label: 'Sonarr',
|
|
|
|
|
options,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newSeriesResponse.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -162,6 +177,19 @@ class SonarrAPI {
|
|
|
|
|
} as Partial<SonarrSeries>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (createdSeriesResponse.data.id) {
|
|
|
|
|
logger.info('Sonarr accepted request', { label: 'Sonarr' });
|
|
|
|
|
logger.debug('Sonarr add details', {
|
|
|
|
|
label: 'Sonarr',
|
|
|
|
|
movie: createdSeriesResponse.data,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
logger.error('Failed to add movie to Sonarr', {
|
|
|
|
|
label: 'Sonarr',
|
|
|
|
|
options,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return createdSeriesResponse.data;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
logger.error('Something went wrong adding a series to Sonarr', {
|
|
|
|
|