Skip to content

Commit

Permalink
More compact
Browse files Browse the repository at this point in the history
  • Loading branch information
CDrummond committed May 28, 2022
1 parent fa87a7e commit cd12e80
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/analyse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,13 @@ fn check_dir_entry(db: &mut db::Db, mpath: &Path, entry: DirEntry, track_paths:
let mut cue_track_path = pb.clone();
let ext = pb.extension().unwrap().to_string_lossy();
cue_track_path.set_extension(format!("{}{}1", ext, db::CUE_MARKER));
match cue_track_path.strip_prefix(mpath) {
Ok(cue_track_stripped) => {
let cue_track_sname = String::from(cue_track_stripped.to_string_lossy());
if let Ok(id) = db.get_rowid(&cue_track_sname) {
if id<=0 {
track_paths.push(String::from(cue_file.to_string_lossy()));
}
if let Ok(cue_track_stripped) = cue_track_path.strip_prefix(mpath) {
let cue_track_sname = String::from(cue_track_stripped.to_string_lossy());
if let Ok(id) = db.get_rowid(&cue_track_sname) {
if id<=0 {
track_paths.push(String::from(cue_file.to_string_lossy()));
}
}
Err(_) => { }
}
} else {
if let Ok(id) = db.get_rowid(&sname) {
Expand Down

0 comments on commit cd12e80

Please sign in to comment.