mirror of
https://github.com/Dangoware/dango-music-player.git
synced 2025-04-19 10:02:53 -05:00
Added .exists()
for URI
This commit is contained in:
parent
4a7a6096d6
commit
96069fd9bc
1 changed files with 10 additions and 4 deletions
|
@ -460,6 +460,14 @@ impl URI {
|
|||
};
|
||||
path_str.to_string()
|
||||
}
|
||||
|
||||
pub fn exists(&self) -> Result<bool, std::io::Error> {
|
||||
match self {
|
||||
URI::Local(loc) => loc.try_exists(),
|
||||
URI::Cue {location, ..} => location.try_exists(),
|
||||
URI::Remote(_, _loc) => todo!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToString for URI {
|
||||
|
@ -699,7 +707,7 @@ impl MusicLibrary {
|
|||
Ok(_) => total += 1,
|
||||
Err(_error) => {
|
||||
errors += 1;
|
||||
println!("{}, {:?}: {}", format, target_file.file_name(), _error)
|
||||
//println!("{}, {:?}: {}", format, target_file.file_name(), _error)
|
||||
} // TODO: Handle more of these errors
|
||||
};
|
||||
} else if extension == "cue" {
|
||||
|
@ -707,15 +715,13 @@ impl MusicLibrary {
|
|||
Ok(added) => added,
|
||||
Err(error) => {
|
||||
errors += 1;
|
||||
println!("{}", error);
|
||||
//println!("{}", error);
|
||||
0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
println!("ERRORS: {}", errors);
|
||||
|
||||
Ok(total)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue