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

This commit is contained in:
2024-12-13 14:09:11 -07:00
parent a88d43807e
commit 91ad50350d
2 changed files with 103 additions and 0 deletions
+24
View File
@@ -120,6 +120,23 @@ pub enum SonarrCommand {
},
#[command(about = "Test all Sonarr indexers")]
TestAllIndexers,
#[command(
about = "Toggle monitoring for the specified season that corresponds to the specified series ID"
)]
ToggleSeasonMonitoring {
#[arg(
long,
help = "The Sonarr ID of the series that the season belongs to",
required = true
)]
series_id: i64,
#[arg(
long,
help = "The season number to toggle monitoring for",
required = true
)]
season_number: i64,
},
}
impl From<SonarrCommand> for Command {
@@ -245,6 +262,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrCommand::ToggleSeasonMonitoring {series_id, season_number } => {
let resp = self
.network
.handle_network_event(SonarrEvent::ToggleSeasonMonitoring(Some((series_id, season_number))).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
};
Ok(result)