feat(cli): Support for toggling monitoring for a specific season in Sonarr
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user