mirror of
https://github.com/CDrummond/bliss-analyser.git
synced 2026-10-22 22:32:08 +03:00
Update ignore syntax to allow adding SQL WHERE clauses.
This commit is contained in:
1 parent
6f8f3d52a9
commit
e60a3c7b09
4 files changed
+25
-12
No files matched your search
@@ -249,11 +249,19 @@ impl Db {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_ignore(&self, like:&str) {
|
||||
log::info!("Ignore: {}", like);
|
||||
match self.conn.execute(&format!("UPDATE Tracks SET Ignore=1 WHERE File LIKE \"{}%\"", like), []) {
|
||||
Ok(_) => { },
|
||||
Err(e) => { log::error!("Failed set Ignore column for '{}'. {}", like, e); }
|
||||
pub fn set_ignore(&self, line:&str) {
|
||||
log::info!("Ignore: {}", line);
|
||||
if line.starts_with("SQL:") {
|
||||
let sql = &line[4..];
|
||||
match self.conn.execute(&format!("UPDATE Tracks Set Ignore=1 WHERE {}", sql), []) {
|
||||
Ok(_) => { },
|
||||
Err(e) => { log::error!("Failed set Ignore column for '{}'. {}", line, e); }
|
||||
}
|
||||
} else {
|
||||
match self.conn.execute(&format!("UPDATE Tracks SET Ignore=1 WHERE File LIKE \"{}%\"", line), []) {
|
||||
Ok(_) => { },
|
||||
Err(e) => { log::error!("Failed set Ignore column for '{}'. {}", line, e); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user