mirror of
https://github.com/CDrummond/bliss-analyser.git
synced 2025-04-08 05:00:02 +03:00
If fail to remove old tracks from DB, then output more info.
This commit is contained in:
parent
a35140c10e
commit
7996d9a525
@ -4,6 +4,7 @@
|
||||
2. Update user docs.
|
||||
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.
|
||||
|
||||
0.0.1
|
||||
-----
|
||||
|
@ -169,12 +169,19 @@ impl Db {
|
||||
}
|
||||
log::info!("Num non-existant tracks: {}", to_remove.len());
|
||||
if !dry_run {
|
||||
let count_before = self.get_track_count();
|
||||
let num_to_remove = to_remove.len();
|
||||
for t in to_remove {
|
||||
log::debug!("Remove '{}'", t);
|
||||
match self.conn.execute("DELETE FROM Tracks WHERE File = ?;", params![t]) {
|
||||
Ok(_) => { },
|
||||
Err(_) => { }
|
||||
Err(e) => { log::error!("Failed to remove '{}' - {}", t, e) }
|
||||
}
|
||||
}
|
||||
let count_now = self.get_track_count();
|
||||
if (count_now + num_to_remove) != count_before {
|
||||
log::error!("Failed to remove all tracks. Count before: {}, wanted to remove: {}, count now: {}", count_before, num_to_remove, count_now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user