aboutsummaryrefslogtreecommitdiff
path: root/transcoder/src/thumbnail.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-12-08 19:53:12 +0100
committermetamuffin <metamuffin@disroot.org>2025-12-08 19:53:12 +0100
commit6edf0fd93abf7e58b4c0974e3d3e54bcf8517946 (patch)
tree32577db9d987897d4037ba9af0084b95b55e145c /transcoder/src/thumbnail.rs
parente4584a8135584e6591bac7d5397cf227cf3cff92 (diff)
downloadjellything-6edf0fd93abf7e58b4c0974e3d3e54bcf8517946.tar
jellything-6edf0fd93abf7e58b4c0974e3d3e54bcf8517946.tar.bz2
jellything-6edf0fd93abf7e58b4c0974e3d3e54bcf8517946.tar.zst
human-readable cache keys
Diffstat (limited to 'transcoder/src/thumbnail.rs')
-rw-r--r--transcoder/src/thumbnail.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/transcoder/src/thumbnail.rs b/transcoder/src/thumbnail.rs
index eda9e04..85cb356 100644
--- a/transcoder/src/thumbnail.rs
+++ b/transcoder/src/thumbnail.rs
@@ -1,5 +1,5 @@
use anyhow::{Context, Result};
-use jellycache::{cache_store, CacheKey};
+use jellycache::{cache_store, HashKey};
use log::info;
use std::{
io::Read,
@@ -7,9 +7,9 @@ use std::{
process::{Command, Stdio},
};
-pub fn create_thumbnail(path: &Path, time: f64) -> Result<CacheKey> {
+pub fn create_thumbnail(path: &Path, time: f64) -> Result<String> {
cache_store(
- CacheKey::new_image(("thumbnail", path, time as i64)),
+ format!("media/thumbnail/{}-{}.image", HashKey(path), time as i64),
move || {
info!("creating thumbnail of {path:?} at {time}s",);