fix(sonarr): Pass the series ID and season number alongside all toggle season monitoring events when publishing to the networking channel

This commit is contained in:
2024-12-18 01:12:32 -07:00
parent 1d404d4d2c
commit 18a8b81631
6 changed files with 103 additions and 142 deletions
@@ -37,6 +37,18 @@ impl<'a, 'b> SeriesDetailsHandler<'a, 'b> {
.expect("Series history is undefined"),
SonarrHistoryItem
);
fn extract_series_id_season_number_tuple(&self) -> (i64, i64) {
let series_id = self.app.data.sonarr_data.series.current_selection().id;
let season_number = self
.app
.data
.sonarr_data
.seasons
.current_selection()
.season_number;
(series_id, season_number)
}
}
impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for SeriesDetailsHandler<'a, 'b> {
@@ -259,8 +271,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for SeriesDetailsHandler
}
_ if key == DEFAULT_KEYBINDINGS.toggle_monitoring.key => {
self.app.data.sonarr_data.prompt_confirm = true;
self.app.data.sonarr_data.prompt_confirm_action =
Some(SonarrEvent::ToggleSeasonMonitoring(None));
self.app.data.sonarr_data.prompt_confirm_action = Some(
SonarrEvent::ToggleSeasonMonitoring(self.extract_series_id_season_number_tuple()),
);
self
.app