Skip to content

Commit dcef698

Browse files
committed
fix: test
1 parent 4b7fc11 commit dcef698

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/models.rs

+2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ pub struct PlexContext {
193193
// host of the proxy server
194194
#[salvo(extract(rename = "host"))]
195195
pub host: Option<String>,
196+
// #[salvo(extract(rename = "scheme"))]
197+
// pub scheme: Option<String>,
196198
// photo transcode
197199
pub size: Option<String>,
198200
pub width: Option<i32>,

src/routes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ async fn ntf_watchlist_force(
323323
// use memory_stats::memory_stats;
324324
// dbg!(memory_stats().unwrap().physical_mem / 1024 / 1000);
325325
let params: PlexContext = req.extract().await.unwrap();
326-
dbg!(&req);
327326
if params.clone().token.is_some() {
328327
tokio::spawn(async move {
329328
let url = format!("https://notifications.plex.tv/api/v1/notifications/settings?X-Plex-Token={}", params.clone().token.unwrap());

src/transform.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,19 @@ impl Transform for MediaStyleTransform {
797797
if guid.starts_with("plex://episode") && item.parent_guid.is_some() {
798798
guid = item.parent_guid.clone().unwrap();
799799
}
800-
guid = guid
801-
.replace("plex://", "");
800+
guid = guid.replace("plex://", "");
802801

803802
//let cover_art = item.get_hero_art(plex_client).await;
804-
let cover_art = Some(format!("http://{}/image/hero/{}/{}",
805-
options.host.clone().unwrap(),
803+
let cover_art = Some(format!("{}://{}/image/hero/{}/{}",
804+
match options.forwarded_proto {
805+
Some(v) => v,
806+
None => "http".to_string()
807+
},
808+
match options.forwarded_host {
809+
Some(v) => v,
810+
None => options.host.clone().unwrap()
811+
},
812+
// options.host.clone().unwrap(),
806813
guid,
807814
options.token.clone().unwrap()
808815
));

0 commit comments

Comments
 (0)