mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(services): improve logging for when Radarr movie already exists (#285)
re #260
This commit is contained in:
@@ -76,11 +76,9 @@ class RadarrAPI {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public addMovie = async (
|
public addMovie = async (options: RadarrMovieOptions): Promise<void> => {
|
||||||
options: RadarrMovieOptions
|
|
||||||
): Promise<RadarrMovie> => {
|
|
||||||
try {
|
try {
|
||||||
const response = await this.axios.post<RadarrMovie>(`/movie`, {
|
await this.axios.post<RadarrMovie>(`/movie`, {
|
||||||
title: options.title,
|
title: options.title,
|
||||||
qualityProfileId: options.qualityProfileId,
|
qualityProfileId: options.qualityProfileId,
|
||||||
profileId: options.profileId,
|
profileId: options.profileId,
|
||||||
@@ -94,15 +92,15 @@ class RadarrAPI {
|
|||||||
searchForMovie: options.searchNow,
|
searchForMovie: options.searchNow,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return response.data;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error('Something went wrong adding a movie to Radarr', {
|
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.',
|
||||||
|
{
|
||||||
label: 'Radarr',
|
label: 'Radarr',
|
||||||
message: e.message,
|
errorMessage: e.message,
|
||||||
options,
|
options,
|
||||||
});
|
}
|
||||||
throw new Error(`[Radarr] Failed to add movie: ${e.message}`);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user