mirror of
https://github.com/agersant/polaris
synced 2024-11-10 02:04:13 +00:00
More readable profile markers
This commit is contained in:
parent
028633d0e6
commit
645d5163f3
1 changed files with 16 additions and 6 deletions
|
@ -99,8 +99,15 @@ impl IndexUpdater {
|
|||
Ok(None)
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "profile-index", flame)]
|
||||
fn populate_directory(&mut self, parent: Option<&Path>, path: &Path) -> Result<()> {
|
||||
|
||||
#[cfg(feature = "profile-index")]
|
||||
let _guard = flame::start_guard(format!("dir: {}",
|
||||
path.file_name().map(|s| {
|
||||
s.to_string_lossy().into_owned()
|
||||
}).unwrap_or("Unknown".to_owned())
|
||||
));
|
||||
|
||||
// Find artwork
|
||||
let artwork = {
|
||||
#[cfg(feature = "profile-index")]
|
||||
|
@ -140,8 +147,7 @@ impl IndexUpdater {
|
|||
|
||||
// Insert content
|
||||
for file in fs::read_dir(path)? {
|
||||
#[cfg(feature = "profile-index")]
|
||||
let _guard = flame::start_guard("directory-entry");
|
||||
|
||||
let file_path = match file {
|
||||
Ok(ref f) => f.path(),
|
||||
_ => {
|
||||
|
@ -150,6 +156,13 @@ impl IndexUpdater {
|
|||
}
|
||||
};
|
||||
|
||||
#[cfg(feature = "profile-index")]
|
||||
let _guard = flame::start_guard(format!("file: {}",
|
||||
file_path.as_path().file_name().map(|s| {
|
||||
s.to_string_lossy().into_owned()
|
||||
}).unwrap_or("Unknown".to_owned())
|
||||
));
|
||||
|
||||
if file_path.is_dir() {
|
||||
sub_directories.push(file_path.to_path_buf());
|
||||
continue;
|
||||
|
@ -158,9 +171,6 @@ impl IndexUpdater {
|
|||
if let Some(file_path_string) = file_path.to_str() {
|
||||
if let Some(tags) = metadata::read(file_path.as_path()) {
|
||||
|
||||
#[cfg(feature = "profile-index")]
|
||||
let _guard = flame::start_guard("process_song");
|
||||
|
||||
if tags.year.is_some() {
|
||||
inconsistent_directory_year |=
|
||||
directory_year.is_some() && directory_year != tags.year;
|
||||
|
|
Loading…
Reference in a new issue