fix(sonarr): Pass the indexer ID alongside all DeleteIndexer events when publishing to the networking channel

This commit is contained in:
2024-12-17 22:37:50 -07:00
parent aece20af47
commit db64a0968b
8 changed files with 63 additions and 88 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, SonarrDeleteCommand> for SonarrDeleteComm
SonarrDeleteCommand::Indexer { indexer_id } => {
let resp = self
.network
.handle_network_event(SonarrEvent::DeleteIndexer(Some(indexer_id)).into())
.handle_network_event(SonarrEvent::DeleteIndexer(indexer_id).into())
.await?;
serde_json::to_string_pretty(&resp)?
}
+6 -11
View File
@@ -367,17 +367,12 @@ mod tests {
)))
});
let app_arc = Arc::new(Mutex::new(App::default()));
let delete_episode_file_command = SonarrDeleteCommand::EpisodeFile {
episode_file_id: 1,
};
let delete_episode_file_command = SonarrDeleteCommand::EpisodeFile { episode_file_id: 1 };
let result = SonarrDeleteCommandHandler::with(
&app_arc,
delete_episode_file_command,
&mut mock_network,
)
.handle()
.await;
let result =
SonarrDeleteCommandHandler::with(&app_arc, delete_episode_file_command, &mut mock_network)
.handle()
.await;
assert!(result.is_ok());
}
@@ -389,7 +384,7 @@ mod tests {
mock_network
.expect_handle_network_event()
.with(eq::<NetworkEvent>(
SonarrEvent::DeleteIndexer(Some(expected_indexer_id)).into(),
SonarrEvent::DeleteIndexer(expected_indexer_id).into(),
))
.times(1)
.returning(|_| {