Skip to content

Commit

Permalink
Merge pull request #104 from Stremio/fix/next-video-stream
Browse files Browse the repository at this point in the history
fix(serialize_player): pass stream_request to VideoDeepLinks
  • Loading branch information
elpiel committed Mar 25, 2024
2 parents 75297a3 + df0c2b1 commit e9d46a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions src/model/serialize_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,14 @@ pub fn serialize_player(player: &Player, ctx: &Ctx, streaming_server: &Streaming
next_video: player
.selected
.as_ref()
.and_then(|selected| selected.meta_request.as_ref())
.and_then(|selected| {
selected
.meta_request
.as_ref()
.zip(selected.stream_request.as_ref())
})
.zip(player.next_video.as_ref())
.map(|(request, video)| model::Video {
.map(|((meta_request, stream_request), video)| model::Video {
video,
upcoming: player
.meta_item
Expand Down Expand Up @@ -219,7 +224,8 @@ pub fn serialize_player(player: &Player, ctx: &Ctx, streaming_server: &Streaming
.unwrap_or_default(),
deep_links: VideoDeepLinks::from((
video,
request,
stream_request,
meta_request,
&streaming_server.base_url,
&ctx.profile.settings,
))
Expand Down

0 comments on commit e9d46a4

Please sign in to comment.