Skip to content

Commit fa946cc

Browse files
committed
260410-2149
1 parent 46526bb commit fa946cc

4 files changed

Lines changed: 44 additions & 9 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[library]
2+
music_dir = "~/Music"
3+
index_path = "~/.config/LiPlayerPro/index"
4+
5+
[audio]
6+
device = "hw:2,0"
7+
8+
[ui]
9+
fps = 60
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[colors]
2+
background = "#b3c5ff"
3+
4+
primary = "#b3c5ff"
5+
6+
secondary = "#b3c5ff"
7+
8+
border_active = "#0053d9"
9+
10+
sidebar_header_bg = "#24283b"
11+
12+
progress_bar = "#b3c5ff"
13+
14+
lyric_past = "#c5c3ea"
15+
16+
lyric_present = "#0053d9"
17+
18+
lyric_future = "#b3c5ff"

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ impl App {
398398
}
399399
_ => {}
400400
}
401-
if self.view_stack.len() > old_len {
401+
if self.view_stack.len() != old_len {
402402
self.sidebar_state.select(Some(0));
403403
}
404404
}

src/main.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,22 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5454
let track_count = library.get_track_count();
5555

5656
if track_count == 0 {
57-
let tx_clone = tx.clone();
58-
let lib_clone = Arc::clone(&library);
59-
std::thread::spawn(move || {
60-
lib_clone.build_index("/home/Li2CO3/Music/", tx_clone);
61-
});
62-
} else {
63-
let _ = tx.send(AppEvent::ScanFinished);
64-
}
57+
let tx_clone = tx.clone();
58+
let lib_clone = Arc::clone(&library);
59+
60+
let home = std::env::var("HOME").expect("Failed to get HOME directory");
61+
62+
let music_path = std::path::PathBuf::from(home)
63+
.join("Music")
64+
.to_string_lossy()
65+
.into_owned();
66+
67+
std::thread::spawn(move || {
68+
lib_clone.build_index(&music_path, tx_clone);
69+
});
70+
} else {
71+
let _ = tx.send(AppEvent::ScanFinished);
72+
}
6573

6674
let mut app = App::new(engine, library, config.ui, mpris_tx, mpris_rx);
6775

0 commit comments

Comments
 (0)