Skip to content

Commit

Permalink
feat(stremio-core-protobuf): addon-detail replace addon stremio:// ur…
Browse files Browse the repository at this point in the history
…ls with https://

Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Oct 17, 2024
1 parent 710cc4d commit 0d6562e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stremio-core-protobuf/src/model/fields/addon_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ use stremio_core::models::ctx::Ctx;

impl FromProtobuf<Selected> for models::addon_details::Selected {
fn from_protobuf(&self) -> Selected {
let mut url = self.transport_url.from_protobuf();
if url.scheme() == "stremio" {
let replaced_url = url.as_str().replacen("stremio://", "https://", 1);
url = replaced_url.parse().expect("Should be able to parse URL");

Selected {
transport_url: self.transport_url.from_protobuf(),
}
}
}


impl ToProtobuf<models::addon_details::Selected, ()> for Selected {
fn to_protobuf<E: stremio_core::runtime::Env + 'static>(
&self,
Expand Down

0 comments on commit 0d6562e

Please sign in to comment.