fix(sonarr): Pass the download ID alongside all DeleteDownload events published to the networking channel

This commit is contained in:
2024-12-17 22:27:08 -07:00
parent 906e093152
commit 6c5a73f78f
8 changed files with 57 additions and 68 deletions
+3 -25
View File
@@ -240,7 +240,7 @@ mod test {
#[rstest]
fn test_resource_queue(
#[values(SonarrEvent::GetDownloads, SonarrEvent::DeleteDownload(None))] event: SonarrEvent,
#[values(SonarrEvent::GetDownloads, SonarrEvent::DeleteDownload(0))] event: SonarrEvent,
) {
assert_str_eq!(event.resource(), "/queue");
}
@@ -646,7 +646,7 @@ mod test {
None,
None,
None,
SonarrEvent::DeleteDownload(None),
SonarrEvent::DeleteDownload(1),
Some("/1"),
None,
)
@@ -661,29 +661,7 @@ mod test {
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
assert!(network
.handle_sonarr_event(SonarrEvent::DeleteDownload(None))
.await
.is_ok());
async_server.assert_async().await;
}
#[tokio::test]
async fn test_handle_delete_sonarr_download_event_uses_provided_id() {
let (async_server, app_arc, _server) = mock_servarr_api(
RequestMethod::Delete,
None,
None,
None,
SonarrEvent::DeleteDownload(None),
Some("/1"),
None,
)
.await;
let mut network = Network::new(&app_arc, CancellationToken::new(), Client::new());
assert!(network
.handle_sonarr_event(SonarrEvent::DeleteDownload(Some(1)))
.handle_sonarr_event(SonarrEvent::DeleteDownload(1))
.await
.is_ok());