diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-24 23:06:33 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-24 23:06:33 +0100 |
| commit | 2bcccb18a6cb8bf836f57c3d86f759b19699def2 (patch) | |
| tree | ef55a10c6d9703677a983b8ca900fb4578a08eb3 /stream/src/metadata.rs | |
| parent | b2e88a8beabf04adc28947cf82996e8692a68b71 (diff) | |
| download | jellything-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.rs | 8 |
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)?; |