Skip to content

Commit 1897fd4

Browse files
committed
fix: add token to images
1 parent e63c87a commit 1897fd4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/routes.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub fn route() -> Router {
156156
)
157157
.push(
158158
Router::new()
159-
.path("/image/hero/<type>/<uuid>/<**token>")
159+
.path("/image/hero/<type>/<uuid>/<token>.jpg")
160160
// .path("/image/hero.jpg")
161161
.get(hero_image)
162162
//.get(proxy_request),
@@ -388,8 +388,9 @@ pub async fn hero_image(
388388
// dbg!(&req);
389389
let t = req.param::<String>("type").unwrap();
390390
let uuid = req.param::<String>("uuid").unwrap();
391-
let token = req.param::<String>("**token");
392-
dbg!(&token);
391+
let token = req.param::<String>("token");
392+
393+
// some clients do not send token for an image request, so we include it in the urk ourself.
393394
if token.is_some() {
394395
params.token = token;
395396
}

src/transform.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ impl Transform for MediaStyleTransform {
801801
.replace("plex://", "");
802802

803803
//let cover_art = item.get_hero_art(plex_client).await;
804-
let cover_art = Some(format!("{}/image/hero/{}/{}",
804+
let cover_art = Some(format!("{}/image/hero/{}/{}.jpg",
805805
options.host.clone().unwrap(),
806806
guid,
807807
options.token.clone().unwrap()

0 commit comments

Comments
 (0)