From 72bbd76c590fa39db681ba87f772225c776a8288 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Thu, 17 Oct 2024 19:10:25 +0300 Subject: [PATCH] feat(stremio-core-protobuf): addon-detail replace addon stremio:// urls with https:// Signed-off-by: Lachezar Lechev --- stremio-core-protobuf/src/model/fields/addon_detail.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/stremio-core-protobuf/src/model/fields/addon_detail.rs b/stremio-core-protobuf/src/model/fields/addon_detail.rs index ca2012f..d3adcf6 100644 --- a/stremio-core-protobuf/src/model/fields/addon_detail.rs +++ b/stremio-core-protobuf/src/model/fields/addon_detail.rs @@ -5,8 +5,16 @@ use stremio_core::models::ctx::Ctx; impl FromProtobuf 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 + }, } } }