feat(cli): Added support for manually searching for season releases for Sonarr

This commit is contained in:
2024-11-19 16:39:21 -07:00
parent 16bf06426f
commit 540db5993b
3 changed files with 104 additions and 1 deletions
+23
View File
@@ -42,6 +42,19 @@ pub enum SonarrCommand {
List(SonarrListCommand),
#[command(about = "Clear the blocklist")]
ClearBlocklist,
#[command(
about = "Trigger a manual search of releases for the given season corresponding to the series with the given ID"
)]
ManualSeasonSearch {
#[arg(
long,
help = "The Sonarr ID of the series whose releases you wish to fetch and list",
required = true
)]
series_id: i64,
#[arg(long, help = "The season number to search for", required = true)]
season_number: i64,
},
}
impl From<SonarrCommand> for Command {
@@ -93,6 +106,16 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrCommand> for SonarrCliHandler<'a, '
.await?;
execute_network_event!(self, SonarrEvent::ClearBlocklist);
}
SonarrCommand::ManualSeasonSearch {
series_id,
season_number,
} => {
println!("Searching for season releases. This may take a minute...");
execute_network_event!(
self,
SonarrEvent::GetSeasonReleases(Some((series_id, season_number)))
);
}
}
Ok(())