Commit 9c8ee86 1 parent 9ffb41a commit 9c8ee86 Copy full SHA for 9c8ee86
File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 36
36
RUST_BACKTRACE=0 \
37
37
RUST_LOG="info,replex=debug" \
38
38
REPLEX_NTF_WATCHLIST_FORCE=0 \
39
- RUSTFLAGS=-Awarnings \
40
39
cargo watch -w src -x run
41
40
42
41
fix :
Original file line number Diff line number Diff line change @@ -308,14 +308,20 @@ async fn resolve_local_media_path(
308
308
req : & mut Request ,
309
309
res : & mut Response ,
310
310
) {
311
- let context: PlexContext = req. extract ( ) . await . unwrap ( ) ;
311
+ let mut context: PlexContext = req. extract ( ) . await . unwrap ( ) ;
312
312
let url = req. query :: < String > ( "url" ) ;
313
313
if url. is_some ( ) && url. clone ( ) . unwrap ( ) . contains ( "/replex/image/hero" )
314
314
{
315
315
let uri: url:: Url = url:: Url :: parse ( url. unwrap ( ) . as_str ( ) ) . unwrap ( ) ;
316
- let uuid = uri. path_segments ( ) . unwrap ( ) . last ( ) ;
316
+ let segments = uri. path_segments ( ) . unwrap ( ) . collect :: < Vec < & str > > ( ) ;
317
+
318
+ let uuid = segments[ segments. len ( ) - 2 ] ;
319
+ if context. token . is_none ( ) {
320
+ context. token = Some ( segments. last ( ) . unwrap ( ) . to_string ( ) ) ;
321
+ }
322
+
317
323
let plex_client = PlexClient :: from_context ( & context) ;
318
- let rurl = plex_client. get_hero_art ( uuid. unwrap ( ) . to_string ( ) ) . await ;
324
+ let rurl = plex_client. get_hero_art ( uuid. to_string ( ) ) . await ;
319
325
if rurl. is_some ( ) {
320
326
add_query_param_salvo ( req, "url" . to_string ( ) , rurl. unwrap ( ) ) ;
321
327
}
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ impl Transform for MediaStyleTransform {
43
43
}
44
44
guid = guid. replace ( "plex://" , "" ) ;
45
45
46
- let cover_art = Some ( format ! ( "/replex/image/hero/{}?X-Plex-Token= {}" ,
46
+ let cover_art = Some ( format ! ( "/replex/image/hero/{}/ {}" ,
47
47
// let cover_art = Some(format!("{}://{}/replex/image/hero/{}?X-Plex-Token={}",
48
48
// match options.forwarded_proto {
49
49
// Some(v) => v,
You can’t perform that action at this time.
0 commit comments