fix(sonarr): Pass the episode ID alongside all GetEpisodeDetails events when publishing to the networking channel
This commit is contained in:
+15
-1
@@ -69,7 +69,9 @@ impl<'a> App<'a> {
|
||||
}
|
||||
ActiveSonarrBlock::EpisodeDetails | ActiveSonarrBlock::EpisodeFile => {
|
||||
self
|
||||
.dispatch_network_event(SonarrEvent::GetEpisodeDetails(None).into())
|
||||
.dispatch_network_event(
|
||||
SonarrEvent::GetEpisodeDetails(self.extract_episode_id().await).into(),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
ActiveSonarrBlock::EpisodeHistory => {
|
||||
@@ -242,4 +244,16 @@ impl<'a> App<'a> {
|
||||
.collect();
|
||||
self.data.sonarr_data.seasons.set_items(seasons);
|
||||
}
|
||||
|
||||
async fn extract_episode_id(&self) -> i64 {
|
||||
self
|
||||
.data
|
||||
.sonarr_data
|
||||
.season_details_modal
|
||||
.as_ref()
|
||||
.expect("Season details have not been loaded")
|
||||
.episodes
|
||||
.current_selection()
|
||||
.id
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user