feat: Full CLI and TUI support for the Lidarr Indexers tab
This commit is contained in:
@@ -86,6 +86,15 @@ pub enum LidarrCommand {
|
||||
)]
|
||||
query: String,
|
||||
},
|
||||
#[command(
|
||||
about = "Test the indexer with the given ID. Note that a successful test returns an empty JSON body; i.e. '{}'"
|
||||
)]
|
||||
TestIndexer {
|
||||
#[arg(long, help = "The ID of the indexer to test", required = true)]
|
||||
indexer_id: i64,
|
||||
},
|
||||
#[command(about = "Test all Lidarr indexers")]
|
||||
TestAllIndexers,
|
||||
#[command(
|
||||
about = "Toggle monitoring for the specified album corresponding to the given album ID"
|
||||
)]
|
||||
@@ -190,6 +199,21 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, LidarrCommand> for LidarrCliHandler<'a, '
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
LidarrCommand::TestIndexer { indexer_id } => {
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(LidarrEvent::TestIndexer(indexer_id).into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
LidarrCommand::TestAllIndexers => {
|
||||
println!("Testing all Lidarr indexers. This may take a minute...");
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(LidarrEvent::TestAllIndexers.into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
LidarrCommand::ToggleAlbumMonitoring { album_id } => {
|
||||
let resp = self
|
||||
.network
|
||||
|
||||
Reference in New Issue
Block a user