Skip to content

Commit

Permalink
refactor: move ToProtobuf MetaItemDeepLinks trait to deep_links
Browse files Browse the repository at this point in the history
  • Loading branch information
tymmesyde committed Oct 23, 2024
1 parent c53612d commit eb05d23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 13 additions & 1 deletion src/commonMain/rust/bridge/deep_links.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::bridge::ToProtobuf;
use crate::protobuf::stremio::core::types;
use stremio_core::deep_links::{ExternalPlayerLink, LibraryItemDeepLinks, StreamDeepLinks};
use stremio_core::deep_links::{
ExternalPlayerLink, LibraryItemDeepLinks, MetaItemDeepLinks, StreamDeepLinks,
};

impl ToProtobuf<types::LibraryItemDeepLinks, ()> for LibraryItemDeepLinks {
fn to_protobuf(&self, _args: &()) -> types::LibraryItemDeepLinks {
Expand All @@ -13,6 +15,16 @@ impl ToProtobuf<types::LibraryItemDeepLinks, ()> for LibraryItemDeepLinks {
}
}

impl ToProtobuf<types::MetaItemDeepLinks, ()> for MetaItemDeepLinks {
fn to_protobuf(&self, _args: &()) -> types::MetaItemDeepLinks {
types::MetaItemDeepLinks {
meta_details_videos: self.meta_details_videos.clone(),
meta_details_streams: self.meta_details_streams.clone(),
player: self.player.clone(),
}
}
}

impl ToProtobuf<types::StreamDeepLinks, ()> for StreamDeepLinks {
fn to_protobuf(&self, _args: &()) -> types::StreamDeepLinks {
types::StreamDeepLinks {
Expand Down
10 changes: 0 additions & 10 deletions src/commonMain/rust/bridge/meta_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ impl ToProtobuf<types::MetaItemBehaviorHints, ()> for MetaItemBehaviorHints {
}
}

impl ToProtobuf<types::MetaItemDeepLinks, ()> for MetaItemDeepLinks {
fn to_protobuf(&self, _args: &()) -> types::MetaItemDeepLinks {
types::MetaItemDeepLinks {
meta_details_videos: self.meta_details_videos.clone(),
meta_details_streams: self.meta_details_streams.clone(),
player: self.player.clone(),
}
}
}

impl ToProtobuf<types::MetaItemPreview, (&Ctx, &ResourceRequest)> for MetaItemPreview {
fn to_protobuf(
&self,
Expand Down

0 comments on commit eb05d23

Please sign in to comment.