Skip to content

Commit

Permalink
fix(stremio-core-kotlin): Player & MetaDetails to_protobuf args
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Dec 18, 2024
1 parent b73d1fd commit e5731b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions stremio-core-kotlin/src/commonMain/rust/model/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl AndroidModel {
.encode_to_vec(),
AndroidModelField::MetaDetails => self
.meta_details
.to_protobuf::<AndroidEnv>(&self.ctx)
.to_protobuf::<AndroidEnv>(&(&self.ctx, &self.streaming_server))
.encode_to_vec(),
AndroidModelField::AddonDetails => self
.addon_details
Expand All @@ -176,7 +176,7 @@ impl AndroidModel {
.encode_to_vec(),
AndroidModelField::Player => self
.player
.to_protobuf::<AndroidEnv>(&self.ctx)
.to_protobuf::<AndroidEnv>(&(&self.ctx, &self.streaming_server))
.encode_to_vec(),

// guard against new fields being added to the CSharp model
Expand Down
16 changes: 8 additions & 8 deletions stremio-core-protobuf/src/model/fields/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,28 +146,28 @@ impl ToProtobuf<models::player::Selected, Ctx> for Selected {
}
}

impl ToProtobuf<models::Player, (Ctx, StreamingServer)> for Player {
impl ToProtobuf<models::Player, (&Ctx, &StreamingServer)> for Player {
fn to_protobuf<E: stremio_core::runtime::Env + 'static>(
&self,
(ctx, streaming_server): &(Ctx, StreamingServer),
(ctx, streaming_server): &(&Ctx, &StreamingServer),
) -> models::Player {
models::Player {
selected: self.selected.to_protobuf::<E>(ctx),
selected: self.selected.to_protobuf::<E>(*ctx),
video_params: self.video_params.to_protobuf::<E>(&()),
meta_item: self.meta_item.as_ref().to_protobuf::<E>(&(
ctx,
streaming_server,
*ctx,
*streaming_server,
self.library_item.as_ref(),
self.watched.as_ref(),
)),
subtitles: self.subtitles.to_protobuf::<E>(ctx),
subtitles: self.subtitles.to_protobuf::<E>(*ctx),
next_video: self
.selected
.as_ref()
.and_then(|selected| selected.meta_request.as_ref())
.and_then(|meta_request| {
self.next_video.to_protobuf::<E>(&(
ctx,
*ctx,
streaming_server.base_url.as_ref(),
self.library_item.as_ref(),
self.watched.as_ref(),
Expand All @@ -176,7 +176,7 @@ impl ToProtobuf<models::Player, (Ctx, StreamingServer)> for Player {
))
}),
series_info: self.series_info.to_protobuf::<E>(&()),
library_item: self.library_item.to_protobuf::<E>(&(ctx, None)),
library_item: self.library_item.to_protobuf::<E>(&(*ctx, None)),
stream_state: self.stream_state.to_protobuf::<E>(&()),
}
}
Expand Down

0 comments on commit e5731b1

Please sign in to comment.