aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-04-18 23:33:29 +0200
committermetamuffin <metamuffin@disroot.org>2025-04-18 23:33:29 +0200
commita123a1997f3ab527ab83b44ca18bec94883f46d0 (patch)
tree761c4f0e8e9bbb7834e59af3d6904dee39932923 /server
parent5b6fd021cc84ae7f5e1719ff398ff4627493a13c (diff)
downloadjellything-a123a1997f3ab527ab83b44ca18bec94883f46d0.tar
jellything-a123a1997f3ab527ab83b44ca18bec94883f46d0.tar.bz2
jellything-a123a1997f3ab527ab83b44ca18bec94883f46d0.tar.zst
use impl Hash for cache key instead of string
Diffstat (limited to 'server')
-rw-r--r--server/src/routes/ui/admin/mod.rs2
-rw-r--r--server/src/routes/ui/assets.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/server/src/routes/ui/admin/mod.rs b/server/src/routes/ui/admin/mod.rs
index 15cc5c0..f44b36c 100644
--- a/server/src/routes/ui/admin/mod.rs
+++ b/server/src/routes/ui/admin/mod.rs
@@ -225,7 +225,7 @@ pub async fn r_admin_transcode_posters(
continue;
}
let source = resolve_asset(asset).await.context("resolving asset")?;
- jellytranscoder::image::transcode(source, AVIF_QUALITY, AVIF_SPEED, 1024)
+ jellytranscoder::image::transcode(&source, AVIF_QUALITY, AVIF_SPEED, 1024)
.await
.context("transcoding asset")?;
}
diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs
index cfaa68e..c661771 100644
--- a/server/src/routes/ui/assets.rs
+++ b/server/src/routes/ui/assets.rs
@@ -31,7 +31,7 @@ pub async fn r_asset(
let session = fed.get_session(&host).await?;
let asset = base64::engine::general_purpose::URL_SAFE.encode(asset);
- async_cache_file(&["fed-asset", &asset], |out| async {
+ async_cache_file("fed-asset", &asset, |out| async {
session.asset(out, &asset, width).await
})
.await?
@@ -40,7 +40,7 @@ pub async fn r_asset(
// fit the resolution into a finite set so the maximum cache is finite too.
let width = 2usize.pow(width.clamp(128, 2048).ilog2());
- jellytranscoder::image::transcode(source, AVIF_QUALITY, AVIF_SPEED, width)
+ jellytranscoder::image::transcode(&source, AVIF_QUALITY, AVIF_SPEED, width)
.await
.context("transcoding asset")?
};
@@ -186,7 +186,7 @@ pub async fn r_node_thumbnail(
)
.await?;
- async_cache_file(&["fed-thumb", &format!("{id} {t}")], |out| {
+ async_cache_file("fed-thumb", (id, t as i64), |out| {
session.node_thumbnail(out, id.into(), 2048, t)
})
.await?