This repository was archived by the owner on Apr 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 3636 RUST_BACKTRACE=0 \
3737 RUST_LOG="info,replex=debug" \
3838 REPLEX_NTF_WATCHLIST_FORCE=0 \
39- RUSTFLAGS=-Awarnings \
4039 cargo watch -w src -x run
4140
4241fix :
Original file line number Diff line number Diff line change @@ -308,14 +308,20 @@ async fn resolve_local_media_path(
308308 req : & mut Request ,
309309 res : & mut Response ,
310310) {
311- let context: PlexContext = req. extract ( ) . await . unwrap ( ) ;
311+ let mut context: PlexContext = req. extract ( ) . await . unwrap ( ) ;
312312 let url = req. query :: < String > ( "url" ) ;
313313 if url. is_some ( ) && url. clone ( ) . unwrap ( ) . contains ( "/replex/image/hero" )
314314 {
315315 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+
317323 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 ;
319325 if rurl. is_some ( ) {
320326 add_query_param_salvo ( req, "url" . to_string ( ) , rurl. unwrap ( ) ) ;
321327 }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ impl Transform for MediaStyleTransform {
4343 }
4444 guid = guid. replace ( "plex://" , "" ) ;
4545
46- let cover_art = Some ( format ! ( "/replex/image/hero/{}?X-Plex-Token= {}" ,
46+ let cover_art = Some ( format ! ( "/replex/image/hero/{}/ {}" ,
4747 // let cover_art = Some(format!("{}://{}/replex/image/hero/{}?X-Plex-Token={}",
4848 // match options.forwarded_proto {
4949 // Some(v) => v,
You can’t perform that action at this time.
0 commit comments