diff options
author | metamuffin <metamuffin@disroot.org> | 2023-08-04 10:16:02 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-08-04 10:16:02 +0200 |
commit | 016b8fec6ed9908e11e72ec7b9930e5908d58a02 (patch) | |
tree | 8b2281a930e4ee1b94282b5b8ef77215e912b38c /import | |
parent | 072d8308d7987e386a1bca9299e42859e2b41ad6 (diff) | |
download | jellything-016b8fec6ed9908e11e72ec7b9930e5908d58a02.tar jellything-016b8fec6ed9908e11e72ec7b9930e5908d58a02.tar.bz2 jellything-016b8fec6ed9908e11e72ec7b9930e5908d58a02.tar.zst |
move seek index write code
Diffstat (limited to 'import')
-rw-r--r-- | import/src/main.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/import/src/main.rs b/import/src/main.rs index bf90eb2..d40916a 100644 --- a/import/src/main.rs +++ b/import/src/main.rs @@ -9,7 +9,7 @@ use anyhow::Context; use clap::{Parser, Subcommand}; use jellycommon::{AssetLocation, MediaInfo, MediaSource, Node, NodeKind, NodePrivate, NodePublic}; use jellymatroska::read::EbmlReader; -use jellyremuxer::import::{import_metadata, seek_index::import_seek_index}; +use jellyremuxer::import::{import_metadata, seek_index}; use log::{info, warn}; use std::{ fs::{remove_file, File}, @@ -115,7 +115,7 @@ fn main() -> anyhow::Result<()> { .transpose()?; let mut kind = NodeKind::Series; - let (mut file_meta, mut seek_index, mut source_path_e) = Default::default(); + let (mut file_meta, mut source_path_e) = Default::default(); if let Some(input_path) = &input { source_path_e = Some(path.join(format!("source.mkv"))); @@ -125,11 +125,6 @@ fn main() -> anyhow::Result<()> { let mut input = EbmlReader::new(input); import_metadata(&mut input)? }); - seek_index = { - let input = File::open(&input_path).unwrap(); - let mut input = EbmlReader::new(input); - import_seek_index(&mut input)? - }; kind = if video { NodeKind::Video @@ -262,14 +257,7 @@ fn main() -> anyhow::Result<()> { } std::os::unix::fs::symlink(&input, &source_path)?; } - for (tn, index) in seek_index { - info!("writing index {tn} with {} blocks", index.blocks.len()); - bincode::encode_into_std_write( - index, - &mut File::create(source_path.with_extension(&format!("si.{tn}")))?, - bincode::config::standard(), - )?; - } + seek_index::write_all(&source_path)?; } let f = File::create(path.join(if series { "directory.json".to_string() |