From be5d0fb9439b682064096c9c897597d911f00f95 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 23 Oct 2024 13:16:25 +0200 Subject: [PATCH] fix(library_item): the player deeplink was omitted --- src/commonMain/rust/bridge/library_item.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/commonMain/rust/bridge/library_item.rs b/src/commonMain/rust/bridge/library_item.rs index 1f78a31..244bf60 100644 --- a/src/commonMain/rust/bridge/library_item.rs +++ b/src/commonMain/rust/bridge/library_item.rs @@ -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; @@ -18,10 +19,16 @@ impl ToProtobuf)> 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(),