mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 09:36:42 +01:00
load metadata using lofty (shout out @Frieder_Hannenheim - you are #1)
This commit is contained in:
parent
28f9220e6c
commit
bc067e2739
4 changed files with 92 additions and 53 deletions
|
|
@ -4,7 +4,6 @@
|
|||
use std::sync::{Arc, RwLock};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::env::{current_dir, set_current_dir};
|
||||
use std::fs::read;
|
||||
use std::thread::{sleep, spawn, JoinHandle};
|
||||
use std::time::Duration;
|
||||
|
||||
|
|
@ -12,7 +11,7 @@ use tengri::{input::*, output::*, tui::*};
|
|||
use crate::crossterm::event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventState, KeyEventKind};
|
||||
|
||||
use clap::{arg, command, value_parser};
|
||||
use walkdir::{WalkDir, DirEntry};
|
||||
use walkdir::WalkDir;
|
||||
use xxhash_rust::xxh3::xxh3_64;
|
||||
use file_type::FileType;
|
||||
|
||||
|
|
@ -55,11 +54,10 @@ fn main () -> Usually<()> {
|
|||
if let Some(true) = args.get_one::<bool>("check") {
|
||||
return Ok(())
|
||||
}
|
||||
return Tui::new()?.run(&state)
|
||||
Tui::new()?.run(&state)
|
||||
} else {
|
||||
panic!("read did not finish")
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn collect (root: &impl AsRef<Path>, thread_count: usize) -> Usually<Arc<RwLock<Vec<Entry>>>> {
|
||||
|
|
@ -96,7 +94,7 @@ fn collect (root: &impl AsRef<Path>, thread_count: usize) -> Usually<Arc<RwLock<
|
|||
});
|
||||
}
|
||||
let timer = Duration::from_millis(100);
|
||||
spawn(move || loop {
|
||||
let _ = spawn(move || loop {
|
||||
if threads.iter().all(|x|x.is_finished()) {
|
||||
break
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue