aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/assets.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-01-23 20:05:39 +0100
committermetamuffin <metamuffin@disroot.org>2024-01-23 20:05:39 +0100
commitabd7489885ffcf76f7f9943ef9e4cd4c304f4d7c (patch)
tree4ee9cd8ad07f8ab7ec6fbcc822926037cadbd53e /server/src/routes/ui/assets.rs
parent3ca7df883ab71c278086a593ed25699ce6b1a608 (diff)
downloadjellything-abd7489885ffcf76f7f9943ef9e4cd4c304f4d7c.tar
jellything-abd7489885ffcf76f7f9943ef9e4cd4c304f4d7c.tar.bz2
jellything-abd7489885ffcf76f7f9943ef9e4cd4c304f4d7c.tar.zst
use cache name for etag
Diffstat (limited to 'server/src/routes/ui/assets.rs')
-rw-r--r--server/src/routes/ui/assets.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs
index d5d2839..7973b0c 100644
--- a/server/src/routes/ui/assets.rs
+++ b/server/src/routes/ui/assets.rs
@@ -19,7 +19,6 @@ pub use jellycommon::AssetRole;
use jellycommon::{AssetLocation, LocalTrack, PeopleGroup, SourceTrackKind, TrackSource};
use log::info;
use rocket::{get, http::ContentType, State};
-use tokio::fs::File;
#[get("/n/<id>/asset?<role>&<width>")]
pub async fn r_item_assets(
@@ -152,6 +151,6 @@ async fn asset_with_res(
info!("loading asset from {path:?}");
Ok((
ContentType::AVIF,
- CacheControlFile::new(File::open(path.path()).await.context("opening file")?).await,
+ CacheControlFile::new_cachekey(&path.path()).await?,
))
}