summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakka <jakka@jakka.su>2025-07-07 21:34:45 +0300
committerjakka <jakka@jakka.su>2025-07-07 21:34:45 +0300
commit66f9da53ccd103eb2c78a10d61b545ea74ab4df6 (patch)
treeec066fccc627002dd994232ef472db081d0aa7a5
parent7d849251f2f7e4419a956452937c7b6e6134151e (diff)
minor code cleanup
-rw-r--r--src/files.rs8
-rw-r--r--src/flac.rs2
2 files changed, 3 insertions, 7 deletions
diff --git a/src/files.rs b/src/files.rs
index 4e09378..7413801 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -60,16 +60,12 @@ fn handle_file(file: impl AsRef<Path>, conn: &Connection) -> Result<()> {
.as_secs();
let db_modtime = conn.get_modtime(&file)?;
if modtime != db_modtime {
- if let Err(error) = conn.update_file(&file) {
- return Err(FileError::new(&file, error).into());
- };
+ conn.update_file(&file)?;
}
return Ok(());
}
- if let Err(error) = conn.insert_file(&file) {
- return Err(FileError::new(file, error).into());
- }
+ conn.insert_file(&file)?;
Ok(())
}
diff --git a/src/flac.rs b/src/flac.rs
index 0879faa..c08ec6c 100644
--- a/src/flac.rs
+++ b/src/flac.rs
@@ -27,7 +27,7 @@ fn write_tags(filename: impl AsRef<Path>, hash: Vec<u8>) -> Result<()> {
match block {
Block::VorbisComment(comment) => {
for (key, val) in comment.comments.clone() {
- if key != "ENCODER" {
+ if key.to_lowercase() != "encoder" || key.to_lowercase() != "encoded by" {
output.set_vorbis(key, val);
}
}