diff options
| author | jakka <jakkadoujin@gmail.com> | 2025-06-19 14:39:55 +0300 |
|---|---|---|
| committer | jakka <jakkadoujin@gmail.com> | 2025-06-19 14:39:55 +0300 |
| commit | 1fea9b682b6ed08b17495374a8ede21b51101faa (patch) | |
| tree | 6efa70f8a33271d5b3c9128d65a95944030f8159 /src/flac.rs | |
| parent | f891f1d379984215e90ebe0958f942836e800385 (diff) | |
reworked encoding async logic
Diffstat (limited to 'src/flac.rs')
| -rw-r--r-- | src/flac.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/flac.rs b/src/flac.rs index 42f9d21..97f61b5 100644 --- a/src/flac.rs +++ b/src/flac.rs @@ -15,8 +15,6 @@ use symphonia::core::{ meta::MetadataOptions, }; -use crate::files; - pub const CURRENT_VENDOR: &str = "reference libFLAC 1.5.0 20250211"; type BoxedFormatReader = Box<dyn FormatReader>; @@ -281,7 +279,7 @@ fn encode_cycle_32( Ok(hasher.finalize().to_vec()) } -fn encode_file(filename: impl AsRef<Path>) -> Result<()> { +pub fn encode_file(filename: impl AsRef<Path>) -> Result<()> { let filencoder = FileEncoder::new(filename)?; let mut outf = File::create(filencoder.temp_name())?; @@ -299,14 +297,6 @@ fn encode_file(filename: impl AsRef<Path>) -> Result<()> { filencoder.encode(enc) } -pub fn handle_encode(file: impl AsRef<Path>) -> Result<impl AsRef<Path>> { - if let Err(error) = encode_file(&file) { - Err(anyhow!(files::FileError::new(file, error))) - } else { - Ok(file) - } -} - pub fn get_vendor(file: impl AsRef<Path>) -> Result<String> { if let Some(vorbis) = Tag::read_from_path(file)?.vorbis_comments() { Ok(vorbis.vendor_string.to_owned()) |
