feat(cli): Support for toggling monitoring on a specific episode in Sonarr

This commit is contained in:
2024-12-13 14:49:00 -07:00
parent 4001dee1bd
commit a28f8c3dd2
2 changed files with 74 additions and 0 deletions
+18
View File
@@ -120,6 +120,17 @@ pub enum SonarrCommand {
},
#[command(about = "Test all Sonarr indexers")]
TestAllIndexers,
#[command(
about = "Toggle monitoring for the specified episode"
)]
ToggleEpisodeMonitoring {
#[arg(
long,
help = "The Sonarr ID of the episode to toggle monitoring on",
required = true
)]
episode_id: i64,
},
#[command(
about = "Toggle monitoring for the specified season that corresponds to the specified series ID"
)]
@@ -262,6 +273,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrCommand::ToggleEpisodeMonitoring { episode_id } => {
let resp = self
.network
.handle_network_event(SonarrEvent::ToggleEpisodeMonitoring(Some(episode_id)).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrCommand::ToggleSeasonMonitoring {series_id, season_number } => {
let resp = self
.network