feat: Support toggling Series monitoring directly from the Sonarr library view [#43]

This commit is contained in:
2025-08-08 14:48:27 -06:00
parent bff3795cc6
commit 8e7e31f64d
4 changed files with 85 additions and 1 deletions
@@ -46,6 +46,9 @@ pub(super) struct LibraryHandler<'a, 'b> {
impl LibraryHandler<'_, '_> {
handle_table_events!(self, series, self.app.data.sonarr_data.series, Series);
fn extract_series_id(&self) -> i64 {
self.app.data.sonarr_data.series.current_selection().id
}
}
impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for LibraryHandler<'a, 'b> {
@@ -205,6 +208,16 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for LibraryHandler<'a, '
self.app.data.sonarr_data.add_series_search = Some(HorizontallyScrollableText::default());
self.app.ignore_special_keys_for_textbox_input = true;
}
_ if matches_key!(toggle_monitoring, key) => {
self.app.data.sonarr_data.prompt_confirm = true;
self.app.data.sonarr_data.prompt_confirm_action = Some(
SonarrEvent::ToggleSeriesMonitoring(self.extract_series_id()),
);
self
.app
.pop_and_push_navigation_stack(self.active_sonarr_block.into());
}
_ if matches_key!(update, key) => {
self
.app