Skip to content

Commit 2467d43

Browse files
committed
fix: hero images for web
1 parent 9c8ee86 commit 2467d43

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/routes.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ async fn resolve_local_media_path(
315315
let uri: url::Url = url::Url::parse(url.unwrap().as_str()).unwrap();
316316
let segments = uri.path_segments().unwrap().collect::<Vec<&str>>();
317317

318-
let uuid = segments[segments.len() - 2];
319-
if context.token.is_none() {
320-
context.token = Some(segments.last().unwrap().to_string());
321-
}
318+
let uuid = segments.last().unwrap().replace(".jpg", "");
319+
//if context.token.is_none() {
320+
// context.token = Some(segments.last().unwrap().to_string());
321+
//}
322322

323323
let plex_client = PlexClient::from_context(&context);
324324
let rurl = plex_client.get_hero_art(uuid.to_string()).await;

src/transform/media_style.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ impl Transform for MediaStyleTransform {
4343
}
4444
guid = guid.replace("plex://", "");
4545

46-
let cover_art = Some(format!("/replex/image/hero/{}/{}",
47-
// let cover_art = Some(format!("{}://{}/replex/image/hero/{}?X-Plex-Token={}",
46+
// let cover_art = Some(format!("/replex/image/hero/{}/{}",
47+
let cover_art = Some(format!("/replex/image/hero/{}.jpg?X-Plex-Token={}",
4848
// match options.forwarded_proto {
4949
// Some(v) => v,
5050
// None => "http".to_string()

0 commit comments

Comments
 (0)