feat: Support toggling Series monitoring from the CLI

This commit is contained in:
2025-08-08 14:46:35 -06:00
parent 8782f1353d
commit bff3795cc6
4 changed files with 189 additions and 4 deletions
+18
View File
@@ -146,6 +146,17 @@ pub enum SonarrCommand {
)]
season_number: i64,
},
#[command(
about = "Toggle monitoring for the specified series corresponding to the given series ID"
)]
ToggleSeriesMonitoring {
#[arg(
long,
help = "The Sonarr ID of the series to toggle monitoring on",
required = true
)]
series_id: i64,
},
}
impl From<SonarrCommand> for Command {
@@ -290,6 +301,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrCommand::ToggleSeriesMonitoring { series_id } => {
let resp = self
.network
.handle_network_event(SonarrEvent::ToggleSeriesMonitoring(series_id).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
};
Ok(result)