mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(requests): correctly handle when tvdbid is missing (#891)
cleans up media and mediarequest when request to sonarr has failed because of tvdbid
This commit is contained in:
@@ -538,7 +538,9 @@ export class MediaRequest {
|
|||||||
const tvdbId = series.external_ids.tvdb_id ?? media.tvdbId;
|
const tvdbId = series.external_ids.tvdb_id ?? media.tvdbId;
|
||||||
|
|
||||||
if (!tvdbId) {
|
if (!tvdbId) {
|
||||||
this.handleRemoveParentUpdate();
|
const requestRepository = getRepository(MediaRequest);
|
||||||
|
await mediaRepository.remove(media);
|
||||||
|
await requestRepository.remove(this);
|
||||||
throw new Error('Series was missing tvdb id');
|
throw new Error('Series was missing tvdb id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user