Skip to content

Commit

Permalink
fix: Fixed an issue where episodes would only be deleted, but not unm…
Browse files Browse the repository at this point in the history
…onitored when using the 'Unmonitor and delete episode' rule action (#943)
  • Loading branch information
jorenn92 committed Feb 27, 2024
1 parent aa2d46f commit 070b381
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions server/src/modules/api/servarr-api/helpers/sonarr.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,14 @@ export class SonarrApi extends ServarrApi<{
);

for (const e of episodes) {
// unmonitor
await this.runPut(
`episode/${e.id}`,
JSON.stringify({ ...e, monitored: false }),
);
// also delete if required
if (deleteFiles) {
await this.runDelete(`episodefile/${e.episodeFileId}`);
} else {
await this.runPut(
`episode/${e.id}`,
JSON.stringify({ ...e, monitored: false }),
);
}
}
} catch (e) {
Expand Down

0 comments on commit 070b381

Please sign in to comment.