Skip to content

Commit

Permalink
Merge pull request #696 from Stremio/feat/video-deep-links-meta-detai…
Browse files Browse the repository at this point in the history
…ls-videos

feat(deep_links): add meta_details_videos to VideoDeepLinks
  • Loading branch information
tymmesyde authored Jun 18, 2024
2 parents 7005dbe + 7fa8508 commit c0503f1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/deep_links/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ impl From<(&MetaItem, &ResourceRequest)> for MetaItemDeepLinks {
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct VideoDeepLinks {
pub meta_details_videos: String,
pub meta_details_streams: String,
pub player: Option<String>,
pub external_player: Option<ExternalPlayerLink>,
Expand All @@ -341,6 +342,11 @@ impl From<(&Video, &ResourceRequest, &Option<Url>, &Settings)> for VideoDeepLink
) -> Self {
let stream = video.stream();
VideoDeepLinks {
meta_details_videos: format!(
"stremio:///detail/{}/{}",
utf8_percent_encode(&request.path.r#type, URI_COMPONENT_ENCODE_SET),
utf8_percent_encode(&request.path.id, URI_COMPONENT_ENCODE_SET),
),
meta_details_streams: format!(
"stremio:///detail/{}/{}/{}",
utf8_percent_encode(&request.path.r#type, URI_COMPONENT_ENCODE_SET),
Expand Down Expand Up @@ -389,6 +395,11 @@ impl
) -> Self {
let stream = video.stream();
VideoDeepLinks {
meta_details_videos: format!(
"stremio:///detail/{}/{}",
utf8_percent_encode(&meta_request.path.r#type, URI_COMPONENT_ENCODE_SET),
utf8_percent_encode(&meta_request.path.id, URI_COMPONENT_ENCODE_SET),
),
meta_details_streams: format!(
"stremio:///detail/{}/{}/{}",
utf8_percent_encode(&meta_request.path.r#type, URI_COMPONENT_ENCODE_SET),
Expand Down

0 comments on commit c0503f1

Please sign in to comment.