diff --git a/Cargo.lock b/Cargo.lock index 441bd32..2fded5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1313,15 +1313,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.11.0" @@ -2639,27 +2630,6 @@ dependencies = [ "protox", "semver", "stremio-core", - "stremio-core-web", - "url", -] - -[[package]] -name = "stremio-core-web" -version = "0.47.8" -source = "git+https://github.com/Stremio/stremio-core?branch=development#416b2f9ca09e25799b4dab36717f8b2186e7cab8" -dependencies = [ - "boolinator", - "chrono", - "either", - "enclose", - "futures", - "itertools 0.10.5", - "once_cell", - "semver", - "serde", - "serde_json", - "stremio-core", - "tracing", "url", ] diff --git a/stremio-core-protobuf/Cargo.toml b/stremio-core-protobuf/Cargo.toml index 5215c2c..ebd4a2c 100644 --- a/stremio-core-protobuf/Cargo.toml +++ b/stremio-core-protobuf/Cargo.toml @@ -6,12 +6,10 @@ edition = "2021" authors = ["Smart Code OOD", "Lachezar Lechev "] [features] -default = ["model-deser"] -model-deser = ["dep:stremio-core-web"] +default = [] [dependencies] stremio-core.workspace = true -stremio-core-web = { workspace = true, optional = true } # Protobuf prost.workspace = true diff --git a/stremio-core-protobuf/src/bridge/event.rs b/stremio-core-protobuf/src/bridge/event.rs index 7c6e74a..0f81160 100644 --- a/stremio-core-protobuf/src/bridge/event.rs +++ b/stremio-core-protobuf/src/bridge/event.rs @@ -3,8 +3,10 @@ use stremio_core::{ runtime::{msg::Event, RuntimeEvent}, }; -use crate::bridge::ToProtobuf; -use crate::stremio_core_models::runtime::{self, Field}; +use crate::{ + bridge::ToProtobuf, + stremio_core_models::runtime::{self, Field}, +}; impl ToProtobuf for Event { fn to_protobuf(&self, _args: &()) -> runtime::Event { @@ -213,26 +215,6 @@ impl ToProtobuf for Event { } } -// impl ToProtobuf for RuntimeEvent { -// fn to_protobuf(&self, _args: &()) -> runtime::RuntimeEvent { -// let event = match self { -// RuntimeEvent::NewState(fields, ..) => { -// runtime::runtime_event::Event::NewState(runtime::runtime_event::NewState { -// fields: fields -// .to_protobuf::(&()) -// .iter() -// .map(|field| *field as i32) -// .collect(), -// }) -// } -// RuntimeEvent::CoreEvent(event) => { -// runtime::runtime_event::Event::CoreEvent(event.to_protobuf::(&())) -// } -// }; -// runtime::RuntimeEvent { event: Some(event) } -// } -// } - impl ToProtobuf for RuntimeEvent where E: stremio_core::runtime::Env + 'static, diff --git a/stremio-core-protobuf/src/bridge/resource_loadable.rs b/stremio-core-protobuf/src/bridge/resource_loadable.rs index 8006d2d..1973f78 100644 --- a/stremio-core-protobuf/src/bridge/resource_loadable.rs +++ b/stremio-core-protobuf/src/bridge/resource_loadable.rs @@ -1,37 +1,21 @@ use inflector::Inflector; use url::Url; -use stremio_core::deep_links::DiscoverDeepLinks; -use stremio_core::models::common::{DescriptorLoadable, ResourceLoadable}; -use stremio_core::models::ctx::Ctx; -use stremio_core::types::addon::{DescriptorPreview, ResourceRequest}; -use stremio_core::types::library::LibraryItem; -use stremio_core::types::resource::{MetaItem, MetaItemPreview, Stream, Subtitles}; -use stremio_core::types::watched_bitfield::WatchedBitField; +use stremio_core::{ + deep_links::DiscoverDeepLinks, + models::{ + common::{DescriptorLoadable, ResourceLoadable}, + ctx::Ctx, + }, + types::{ + addon::{DescriptorPreview, ResourceRequest}, + library::LibraryItem, + resource::{MetaItem, MetaItemPreview, Stream, Subtitles}, + watched_bitfield::WatchedBitField, + }, +}; -use crate::bridge::ToProtobuf; -use crate::protobuf::stremio::core::models; -// use crate::stremio_core_models::types::ResourcePath; - -// impl<'a> ToProtobuf for stremio_core_web::model::serialize_catalogs_with_extra::ResourceLoadable<'a> { -// fn to_protobuf(&self, ctx: &Ctx) -> models::LoadablePage { -// let deep_links = DiscoverDeepLinks::from(&self.request).to_protobuf::(&()); -// models::LoadablePage { -// title: self.name.to_string(), -// request: crate::protobuf::stremio::core::types::ResourceRequest { -// base: "todo".into(), -// path: ResourcePath { -// resource: "todo".to_string(), -// r#type: "todo".into(), -// id: "todo".into(), -// extra: vec![], -// }, -// }, -// content: self.content.to_protobuf::(&(ctx, &self.request)), -// deep_links, -// } -// } -// } +use crate::{bridge::ToProtobuf, protobuf::stremio::core::models}; impl ToProtobuf for ResourceLoadable> { fn to_protobuf( diff --git a/stremio-core-protobuf/src/model/fields/catalogs_with_extra.rs b/stremio-core-protobuf/src/model/fields/catalogs_with_extra.rs index 6a041fe..62eb490 100644 --- a/stremio-core-protobuf/src/model/fields/catalogs_with_extra.rs +++ b/stremio-core-protobuf/src/model/fields/catalogs_with_extra.rs @@ -48,17 +48,6 @@ impl ToProtobuf for CatalogsWithExtra { } } -#[cfg(feature = "model-deser")] -impl stremio_core_web::model::SerializeModel> for models::CatalogsWithExtra { - type Error = (); - - fn serialize_model(&self) -> Result, Self::Error> { - use prost::Message; - - Ok(self.clone().encode_to_vec()) - } -} - impl ToProtobuf for DiscoverDeepLinks { fn to_protobuf( &self,