feat(cli): Sonarr support for fetching a list of all episode files for a given series ID

This commit is contained in:
2024-12-10 16:32:35 -07:00
parent cbad40245f
commit 7bf3311102
2 changed files with 75 additions and 0 deletions
+16
View File
@@ -33,6 +33,15 @@ pub enum SonarrListCommand {
)]
series_id: i64,
},
#[command(about = "List the episode files for the series with the given ID")]
EpisodeFiles {
#[arg(
long,
help = "The Sonarr ID of the series whose episode files you wish to fetch",
required = true
)]
series_id: i64,
},
#[command(about = "Fetch all history events for the episode with the given ID")]
EpisodeHistory {
#[arg(
@@ -158,6 +167,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrListCommand::EpisodeFiles { series_id } => {
let resp = self
.network
.handle_network_event(SonarrEvent::GetEpisodeFiles(Some(series_id)).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrListCommand::EpisodeHistory { episode_id } => {
let resp = self
.network