fix: AddRootFolderBody now constructed prior to AddRootFolder event being sent down the network channel
This commit is contained in:
@@ -4,6 +4,8 @@ use anyhow::Result;
|
||||
use clap::{arg, command, ArgAction, Subcommand};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use super::RadarrCommand;
|
||||
use crate::models::servarr_models::AddRootFolderBody;
|
||||
use crate::{
|
||||
app::App,
|
||||
cli::{CliCommandHandler, Command},
|
||||
@@ -11,8 +13,6 @@ use crate::{
|
||||
network::{radarr_network::RadarrEvent, NetworkTrait},
|
||||
};
|
||||
|
||||
use super::RadarrCommand;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "add_command_handler_tests.rs"]
|
||||
mod add_command_handler_tests;
|
||||
@@ -138,9 +138,10 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, RadarrAddCommand> for RadarrAddCommandHan
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
RadarrAddCommand::RootFolder { root_folder_path } => {
|
||||
let add_root_folder_body = AddRootFolderBody { path: root_folder_path };
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(RadarrEvent::AddRootFolder(Some(root_folder_path)).into())
|
||||
.handle_network_event(RadarrEvent::AddRootFolder(add_root_folder_body).into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user