feat(cli): Support for fetching episode history events from Sonarr
This commit is contained in:
@@ -31,6 +31,15 @@ pub enum SonarrListCommand {
|
||||
)]
|
||||
series_id: i64,
|
||||
},
|
||||
#[command(about = "Fetch all history events for the episode with the given ID")]
|
||||
EpisodeHistory {
|
||||
#[arg(
|
||||
long,
|
||||
help = "The Sonarr ID of the episode whose history you wish to fetch",
|
||||
required = true
|
||||
)]
|
||||
episode_id: i64,
|
||||
},
|
||||
#[command(about = "Fetch all Sonarr history events")]
|
||||
History {
|
||||
#[arg(long, help = "How many history events to fetch", default_value_t = 500)]
|
||||
@@ -113,6 +122,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
SonarrListCommand::EpisodeHistory { episode_id } => {
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event((SonarrEvent::GetEpisodeHistory(Some(episode_id))).into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
SonarrListCommand::History { events: items } => {
|
||||
let resp = self
|
||||
.network
|
||||
|
||||
Reference in New Issue
Block a user