feat(cli): Support for listing the available disk space for all provisioned root folders in both Radarr and Sonarr

This commit is contained in:
2024-11-22 15:57:05 -07:00
parent a881d1f33a
commit df3cf70682
4 changed files with 22 additions and 0 deletions
+9
View File
@@ -22,6 +22,8 @@ pub enum SonarrListCommand {
Blocklist,
#[command(about = "List all active downloads in Sonarr")]
Downloads,
#[command(about = "List disk space details for all provisioned root folders in Sonarr")]
DiskSpace,
#[command(about = "List the episodes for the series with the given ID")]
Episodes {
#[arg(
@@ -119,6 +121,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrListCommand::DiskSpace => {
let resp = self
.network
.handle_network_event(SonarrEvent::GetDiskSpace.into())
.await?;
serde_json::to_string_pretty(&resp)?
}
SonarrListCommand::Episodes { series_id } => {
let resp = self
.network
@@ -28,6 +28,7 @@ mod tests {
"blocklist",
"series",
"downloads",
"disk-space",
"quality-profiles",
"indexers",
"queued-events",
@@ -198,6 +199,7 @@ mod tests {
#[rstest]
#[case(SonarrListCommand::Blocklist, SonarrEvent::GetBlocklist)]
#[case(SonarrListCommand::Downloads, SonarrEvent::GetDownloads)]
#[case(SonarrListCommand::DiskSpace, SonarrEvent::GetDiskSpace)]
#[case(SonarrListCommand::Indexers, SonarrEvent::GetIndexers)]
#[case(SonarrListCommand::QualityProfiles, SonarrEvent::GetQualityProfiles)]
#[case(SonarrListCommand::QueuedEvents, SonarrEvent::GetQueuedEvents)]