diff options
Diffstat (limited to 'stream/src/stream_info.rs')
| -rw-r--r-- | stream/src/stream_info.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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 <metamuffin.org> */ -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<SMediaInfo>) -> 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<StreamContainer> { } pub(crate) fn write_stream_info(info: Arc<SMediaInfo>) -> Result<Box<dyn Read + Send + Sync>> { - let (_, info) = stream_info(info)?; + let (_, info) = stream_info(&info)?; Ok(Box::new(Cursor::new(serde_json::to_vec(&info)?))) } |