Fix removing old tracks when run under Windows.

This commit is contained in:
Craig Drummond 2022-03-07 20:27:31 +00:00
parent ee468e723e
commit 05532ec6cd
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@
3. Update ignore syntax to allow adding SQL WHERE clauses.
4. Use newer version of tag reader library.
5. If fail to remove old tracks from DB, then output more info.
6. Fix removing old tracks when run under Windows.
0.0.1
-----

View File

@ -158,13 +158,14 @@ impl Db {
let mut to_remove:Vec<String> = Vec::new();
for tr in track_iter {
let mut db_path:String = tr.unwrap().0;
let orig_path = db_path.clone();
if cfg!(windows) {
db_path = db_path.replace("/", "\\");
}
let path = mpath.join(PathBuf::from(db_path.clone()));
if !path.exists() {
to_remove.push(db_path);
to_remove.push(orig_path);
}
}
let num_to_remove = to_remove.len();