fix(requests): correctly handle when tvdbid is missing (#891)

cleans up media and mediarequest when request to sonarr has failed because of tvdbid
pull/914/head
Jakob Ankarhem 3 years ago committed by GitHub
parent 034968e437
commit e037ba48f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -538,7 +538,9 @@ export class MediaRequest {
const tvdbId = series.external_ids.tvdb_id ?? media.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');
}

Loading…
Cancel
Save