diff --git a/ChangeLog b/ChangeLog index f1427e4..33843b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,8 +11,7 @@ flags. 6. Add option to write analysis results to files, and use for future scans. 7. If log level set to 'trace' then set this level for the Bliss library too. -8. Enable support for '.dsf' files, but only if compiled against ffmpeg - libraries. +8. Enable support for '.dsf' files. 0.2.3 ----- diff --git a/src/analyse.rs b/src/analyse.rs index 61d8aa4..db7e634 100644 --- a/src/analyse.rs +++ b/src/analyse.rs @@ -40,11 +40,7 @@ use bliss_audio::{decoder::Decoder, BlissResult, Song}; const DONT_ANALYSE: &str = ".notmusic"; const MAX_ERRORS_TO_SHOW: usize = 100; const MAX_TAG_ERRORS_TO_SHOW: usize = 50; - -#[cfg(feature = "libav")] const VALID_EXTENSIONS: [&str; 7] = ["m4a", "mp3", "ogg", "flac", "opus", "wv", "dsf"]; -#[cfg(not(feature = "libav"))] -const VALID_EXTENSIONS: [&str; 6] = ["m4a", "mp3", "ogg", "flac", "opus", "wv"]; fn get_file_list(db: &mut db::Db, mpath: &Path, path: &Path, track_paths: &mut Vec, cue_tracks:&mut Vec, file_count:&mut usize, max_num_files: usize, use_tags: bool, tagged_file_count:&mut usize, dry_run: bool) { if !path.is_dir() { @@ -285,7 +281,10 @@ fn analyse_new_files(db: &db::Db, mpath: &PathBuf, track_paths: Vec, max match result { Ok(track) => { let cpath = String::from(path.to_string_lossy()); - let meta = tags::read(&cpath, false); + let mut meta = tags::read(&cpath, false); + if meta.is_empty() { + meta = ffmpeg::read_tags(&cpath); + } if meta.is_empty() { tag_error.push(sname.clone()); } diff --git a/src/ffmpeg.rs b/src/ffmpeg.rs index 4f06404..5a7fad2 100644 --- a/src/ffmpeg.rs +++ b/src/ffmpeg.rs @@ -6,6 +6,7 @@ * **/ +use crate::db; use bliss_audio::decoder::Decoder as DecoderTrait; use bliss_audio::decoder::PreAnalyzedSong; use bliss_audio::{BlissError, BlissResult}; @@ -13,6 +14,8 @@ use std::path::Path; use std::process::{Child, Command, Stdio}; use std::io; use std::io::Read; +use std::io::BufRead; +use std::io::BufReader; use std::time::Duration; pub const TIME_SEP:&str = "