feat(cli): Support for listing all Sonarr tasks

This commit is contained in:
Dark-Alex-17 committed 2024-11-22 16:37:21 -07:00
1 parent c54bd2bab0
commit 22fbe025d9
3 files changed
+13 -2

No files matched your search

+9
View File
@@ -78,6 +78,8 @@ pub enum SonarrListCommand {
},
#[command(about = "List all Sonarr tags")]
Tags,
#[command(about = "List all Sonarr tasks")]
Tasks,
}
impl From<SonarrListCommand> for Command {
@@ -215,6 +217,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrListCommand::Tasks => {
let resp = self
.network
.handle_network_event(SonarrEvent::GetTasks.into())
.await?;
serde_json::to_string_pretty(&resp)?
}
};
Ok(result)