Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(library_item): the player deeplink was omitted #52

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading