feat: Added support for a system-wide notification popup mechanism that works across Servarrs

This commit is contained in:
2026-02-03 17:03:12 -07:00
parent 447cf6a2b4
commit af573cac2a
16 changed files with 587 additions and 21 deletions
+22 -3
View File
@@ -1,3 +1,4 @@
use crate::models::servarr_data::Notification;
use crate::models::sonarr_models::SonarrReleaseDownloadBody;
use crate::network::sonarr_network::SonarrEvent;
use crate::network::{Network, RequestMethod};
@@ -31,8 +32,26 @@ impl Network<'_, '_> {
)
.await;
self
.handle_request::<SonarrReleaseDownloadBody, Value>(request_props, |_, _| ())
.await
let result = self
.handle_request::<SonarrReleaseDownloadBody, Value>(request_props, |_, mut app| {
app.notification = Some(Notification::new(
"Download Result".to_owned(),
"Download request sent successfully".to_owned(),
true,
));
})
.await;
if result.is_err() {
let mut app = self.app.lock().await;
std::mem::take(&mut app.error.text);
app.notification = Some(Notification::new(
"Download Failed".to_owned(),
"Download request failed. Check the logs for more details.".to_owned(),
false,
));
}
result
}
}