fix: AddMovie Radarr event is now populated in the dispatch thread before being sent to the network thread

This commit is contained in:
2024-12-16 15:31:26 -07:00
parent e38e430c77
commit 14c46f88ab
9 changed files with 568 additions and 325 deletions
+2 -1
View File
@@ -125,6 +125,7 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, RadarrAddCommand> for RadarrAddCommandHan
minimum_availability: minimum_availability.to_string(),
monitored: !disable_monitoring,
tags,
tag_input_string: String::new(),
add_options: AddMovieOptions {
monitor: monitor.to_string(),
search_for_movie: !no_search_for_movie,
@@ -132,7 +133,7 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, RadarrAddCommand> for RadarrAddCommandHan
};
let resp = self
.network
.handle_network_event(RadarrEvent::AddMovie(Some(body)).into())
.handle_network_event(RadarrEvent::AddMovie(body).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
+2 -1
View File
@@ -381,6 +381,7 @@ mod tests {
minimum_availability: "released".to_owned(),
monitored: false,
tags: vec![1, 2],
tag_input_string: String::new(),
add_options: AddMovieOptions {
monitor: "movieAndCollection".to_owned(),
search_for_movie: false,
@@ -390,7 +391,7 @@ mod tests {
mock_network
.expect_handle_network_event()
.with(eq::<NetworkEvent>(
RadarrEvent::AddMovie(Some(expected_add_movie_body)).into(),
RadarrEvent::AddMovie(expected_add_movie_body).into(),
))
.times(1)
.returning(|_| {