diff --git a/server/api/radarr.ts b/server/api/radarr.ts index 4797ef5d7..968cb21da 100644 --- a/server/api/radarr.ts +++ b/server/api/radarr.ts @@ -78,7 +78,7 @@ class RadarrAPI { public addMovie = async (options: RadarrMovieOptions): Promise => { try { - await this.axios.post(`/movie`, { + const response = await this.axios.post(`/movie`, { title: options.title, qualityProfileId: options.qualityProfileId, profileId: options.profileId, @@ -92,6 +92,19 @@ class RadarrAPI { searchForMovie: options.searchNow, }, }); + + if (response.data.id) { + logger.info('Radarr accepted request', { label: 'Radarr' }); + logger.debug('Radarr add details', { + label: 'Radarr', + movie: response.data, + }); + } else { + logger.error('Failed to add movie to Radarr', { + label: 'Radarr', + options, + }); + } } catch (e) { logger.error( 'Failed to add movie to Radarr. This might happen if the movie already exists, in which case you can safely ignore this error.', diff --git a/server/api/sonarr.ts b/server/api/sonarr.ts index 903cd4cc6..a49378765 100644 --- a/server/api/sonarr.ts +++ b/server/api/sonarr.ts @@ -126,7 +126,7 @@ class SonarrAPI { series.addOptions = { ignoreEpisodesWithFiles: true, - searchForMissingEpisodes: true, + searchForMissingEpisodes: options.searchNow, }; const newSeriesResponse = await this.axios.put( @@ -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 ); + 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', {