Skip to content

Commit

Permalink
Merge pull request #599 from Stremio/fix/streams-bucket-not-updated-o…
Browse files Browse the repository at this point in the history
…n-load

fix: player - on load insert stream in bucket
  • Loading branch information
elpiel authored Dec 21, 2023
2 parents 93c3e66 + 2e3409e commit 15145fd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/models/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ impl<E: Env + 'static> UpdateWithCtx<E> for Player {
&self.selected,
&ctx.profile.settings,
);
// Make sure to update the steams and in term the StreamsBucket
// once the player loads the newly selected item
let update_streams_effects = match (&self.selected, &self.meta_item) {
(Some(selected), Some(meta_item)) => {
Effects::msg(Msg::Internal(Internal::StreamLoaded {
stream: selected.stream.to_owned(),
stream_request: selected.stream_request.to_owned(),
meta_item: meta_item.to_owned(),
}))
.unchanged()
}
_ => Effects::none().unchanged(),
};
let series_info_effects =
series_info_update(&mut self.series_info, &self.selected, &self.meta_item);
let library_item_effects = library_item_update::<E>(
Expand Down Expand Up @@ -240,6 +253,7 @@ impl<E: Env + 'static> UpdateWithCtx<E> for Player {
.join(next_video_effects)
.join(next_streams_effects)
.join(next_stream_effects)
.join(update_streams_effects)
.join(series_info_effects)
.join(library_item_effects)
.join(watched_effects)
Expand Down

0 comments on commit 15145fd

Please sign in to comment.