From 2bcccb18a6cb8bf836f57c3d86f759b19699def2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 24 Jan 2026 23:06:33 +0100 Subject: cache as object --- stream/src/stream_info.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'stream/src/stream_info.rs') diff --git a/stream/src/stream_info.rs b/stream/src/stream_info.rs index 216c968..4a2605e 100644 --- a/stream/src/stream_info.rs +++ b/stream/src/stream_info.rs @@ -3,7 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin */ -use crate::{cues::generate_cues, metadata::read_metadata, SMediaInfo, CONF}; +use crate::{CONF, SMediaInfo, cues::generate_cues, metadata::read_metadata}; use anyhow::Result; use jellyremuxer::matroska::{self, Segment, TrackEntry, TrackType}; use jellystream_types::{ @@ -22,14 +22,14 @@ pub(crate) struct InternalStreamInfo { } // TODO cache mem -pub(crate) fn stream_info(info: Arc) -> Result<(InternalStreamInfo, StreamInfo)> { +pub(crate) fn stream_info(info: &SMediaInfo) -> Result<(InternalStreamInfo, StreamInfo)> { let mut tracks = Vec::new(); let mut track_to_file = Vec::new(); let mut metadata_arr = Vec::new(); let mut paths = Vec::new(); for (i, path) in info.files.iter().enumerate() { - let metadata = read_metadata(path)?; - let cue_stat = generate_cues(path)?; + let metadata = read_metadata(&info.cache, path)?; + let cue_stat = generate_cues(&info.cache, path)?; if let Some(t) = &metadata.tracks { let duration = media_duration(&metadata.info); for t in &t.entries { @@ -158,7 +158,7 @@ fn containers_by_codec(codec: &str) -> Vec { } pub(crate) fn write_stream_info(info: Arc) -> Result> { - let (_, info) = stream_info(info)?; + let (_, info) = stream_info(&info)?; Ok(Box::new(Cursor::new(serde_json::to_vec(&info)?))) } -- cgit v1.3