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 72bbd76
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion stremio-core-protobuf/src/model/fields/addon_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ use stremio_core::models::ctx::Ctx;

impl FromProtobuf<Selected> for models::addon_details::Selected {
fn from_protobuf(&self) -> Selected {
let transport_url = self.transport_url.from_protobuf();

Selected {
transport_url: self.transport_url.from_protobuf(),
transport_url: if transport_url.scheme() == "stremio" {
let replaced_url = transport_url.as_str().replacen("stremio://", "https://", 1);

replaced_url.parse().expect("Should be able to parse URL")
} else {
transport_url
},
}
}
}
Expand Down

0 comments on commit 72bbd76

Please sign in to comment.