feat(cli): Support for fetching all sonarr language profiles
This commit is contained in:
@@ -49,6 +49,8 @@ pub enum SonarrListCommand {
|
|||||||
},
|
},
|
||||||
#[command(about = "List all Sonarr indexers")]
|
#[command(about = "List all Sonarr indexers")]
|
||||||
Indexers,
|
Indexers,
|
||||||
|
#[command(about = "List all Sonarr language profiles")]
|
||||||
|
LanguageProfiles,
|
||||||
#[command(about = "Fetch Sonarr logs")]
|
#[command(about = "Fetch Sonarr logs")]
|
||||||
Logs {
|
Logs {
|
||||||
#[arg(long, help = "How many log events to fetch", default_value_t = 500)]
|
#[arg(long, help = "How many log events to fetch", default_value_t = 500)]
|
||||||
@@ -160,6 +162,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrListCommand> for SonarrListCommandH
|
|||||||
.await?;
|
.await?;
|
||||||
serde_json::to_string_pretty(&resp)?
|
serde_json::to_string_pretty(&resp)?
|
||||||
}
|
}
|
||||||
|
SonarrListCommand::LanguageProfiles => {
|
||||||
|
let resp = self
|
||||||
|
.network
|
||||||
|
.handle_network_event(SonarrEvent::GetLanguageProfiles.into())
|
||||||
|
.await?;
|
||||||
|
serde_json::to_string_pretty(&resp)?
|
||||||
|
}
|
||||||
SonarrListCommand::Logs {
|
SonarrListCommand::Logs {
|
||||||
events,
|
events,
|
||||||
output_in_log_format,
|
output_in_log_format,
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ mod tests {
|
|||||||
"root-folders",
|
"root-folders",
|
||||||
"tags",
|
"tags",
|
||||||
"tasks",
|
"tasks",
|
||||||
"updates"
|
"updates",
|
||||||
|
"language-profiles"
|
||||||
)]
|
)]
|
||||||
subcommand: &str,
|
subcommand: &str,
|
||||||
) {
|
) {
|
||||||
@@ -211,6 +212,7 @@ mod tests {
|
|||||||
#[case(SonarrListCommand::Tags, SonarrEvent::GetTags)]
|
#[case(SonarrListCommand::Tags, SonarrEvent::GetTags)]
|
||||||
#[case(SonarrListCommand::Tasks, SonarrEvent::GetTasks)]
|
#[case(SonarrListCommand::Tasks, SonarrEvent::GetTasks)]
|
||||||
#[case(SonarrListCommand::Updates, SonarrEvent::GetUpdates)]
|
#[case(SonarrListCommand::Updates, SonarrEvent::GetUpdates)]
|
||||||
|
#[case(SonarrListCommand::LanguageProfiles, SonarrEvent::GetLanguageProfiles)]
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_handle_list_command(
|
async fn test_handle_list_command(
|
||||||
#[case] list_command: SonarrListCommand,
|
#[case] list_command: SonarrListCommand,
|
||||||
|
|||||||
Reference in New Issue
Block a user