aboutsummaryrefslogtreecommitdiff
path: root/stream/src/metadata.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-24 23:06:33 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-24 23:06:33 +0100
commit2bcccb18a6cb8bf836f57c3d86f759b19699def2 (patch)
treeef55a10c6d9703677a983b8ca900fb4578a08eb3 /stream/src/metadata.rs
parentb2e88a8beabf04adc28947cf82996e8692a68b71 (diff)
downloadjellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar
jellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar.bz2
jellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar.zst
cache as object
Diffstat (limited to 'stream/src/metadata.rs')
-rw-r--r--stream/src/metadata.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/stream/src/metadata.rs b/stream/src/metadata.rs
index 640b851..4dedb76 100644
--- a/stream/src/metadata.rs
+++ b/stream/src/metadata.rs
@@ -4,13 +4,13 @@
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
-use anyhow::{anyhow, Result};
-use jellycache::{cache_memory, HashKey};
+use anyhow::{Result, anyhow};
+use jellycache::{Cache, HashKey};
use jellyremuxer::{demuxers::create_demuxer_autodetect, matroska::Segment};
use std::{fs::File, path::Path, sync::Arc};
-pub fn read_metadata(path: &Path) -> Result<Arc<Segment>> {
- cache_memory(
+pub fn read_metadata(cache: &Cache, path: &Path) -> Result<Arc<Segment>> {
+ cache.cache_memory(
&format!("media/stream-metadata/{}.json", HashKey(path)),
move || {
let media = File::open(path)?;