aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/assets.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-02-03 22:42:13 +0100
committermetamuffin <metamuffin@disroot.org>2025-02-03 22:42:13 +0100
commite43dc75e3cfb950ac0d0308900c20fa292de0c46 (patch)
treefce989ad0292328166efede8cfb2b769c370ab24 /server/src/routes/ui/assets.rs
parent11c5be29987912b89fd6d351938d08fe6a561ad2 (diff)
downloadjellything-e43dc75e3cfb950ac0d0308900c20fa292de0c46.tar
jellything-e43dc75e3cfb950ac0d0308900c20fa292de0c46.tar.bz2
jellything-e43dc75e3cfb950ac0d0308900c20fa292de0c46.tar.zst
some jellyfin api endpoints
Diffstat (limited to 'server/src/routes/ui/assets.rs')
-rw-r--r--server/src/routes/ui/assets.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs
index a01c8bc..bd48f35 100644
--- a/server/src/routes/ui/assets.rs
+++ b/server/src/routes/ui/assets.rs
@@ -80,10 +80,9 @@ pub async fn r_item_poster(
}
};
let asset = asset.unwrap_or_else(|| {
- AssetInner::Assets(format!("fallback-{:?}.avif", node.kind).into())
- .ser()
+ AssetInner::Assets(format!("fallback-{:?}.avif", node.kind).into()).ser()
});
- Ok(Redirect::temporary(rocket::uri!(r_asset(asset.0, width))))
+ Ok(Redirect::permanent(rocket::uri!(r_asset(asset.0, width))))
}
#[get("/n/<id>/backdrop?<width>")]
pub async fn r_item_backdrop(
@@ -105,10 +104,9 @@ pub async fn r_item_backdrop(
}
};
let asset = asset.unwrap_or_else(|| {
- AssetInner::Assets(format!("fallback-{:?}.avif", node.kind).into())
- .ser()
+ AssetInner::Assets(format!("fallback-{:?}.avif", node.kind).into()).ser()
});
- Ok(Redirect::temporary(rocket::uri!(r_asset(asset.0, width))))
+ Ok(Redirect::permanent(rocket::uri!(r_asset(asset.0, width))))
}
#[get("/n/<id>/person/<index>/asset?<group>&<width>")]
@@ -137,7 +135,7 @@ pub async fn r_person_asset(
.headshot
.to_owned()
.unwrap_or(AssetInner::Assets("fallback-Person.avif".into()).ser());
- Ok(Redirect::temporary(rocket::uri!(r_asset(asset.0, width))))
+ Ok(Redirect::permanent(rocket::uri!(r_asset(asset.0, width))))
}
// TODO this can create "federation recursion" because track selection cannot be relied on.