Skip to content

Commit

Permalink
Merge pull request #52 from Stremio/fix/library-item-player-deep-link
Browse files Browse the repository at this point in the history
fix(library_item): the player deeplink was omitted
  • Loading branch information
elpiel authored Oct 24, 2024
2 parents fb59485 + be5d0fb commit 818bfdb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/commonMain/rust/bridge/library_item.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use stremio_core::deep_links::LibraryItemDeepLinks;
use stremio_core::models::ctx::Ctx;
use stremio_core::types::library::LibraryItem;
use stremio_core::types::streams::StreamsItemKey;

use crate::bridge::ToProtobuf;
use crate::protobuf::stremio::core::types;
Expand All @@ -18,10 +19,16 @@ impl ToProtobuf<types::LibraryItem, (&Ctx, Option<usize>)> for LibraryItem {
.map(|notifs| notifs.len())
})
.unwrap_or_default();
let streams_item = self.state.video_id.as_ref().and_then(|video_id| {
ctx.streams.items.get(&StreamsItemKey {
meta_id: self.id.to_owned(),
video_id: video_id.to_owned(),
})
});
let settings = &ctx.profile.settings;
let streaming_server_url = &settings.streaming_server_url;
let deep_links =
LibraryItemDeepLinks::from((self, None, Some(streaming_server_url), settings));
LibraryItemDeepLinks::from((self, streams_item, Some(streaming_server_url), settings));
types::LibraryItem {
id: self.id.to_string(),
r#type: self.r#type.to_string(),
Expand Down

0 comments on commit 818bfdb

Please sign in to comment.