diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-05-30 16:18:54 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-05-30 16:18:54 +0530 |
| commit | 6ae0aca8680d2ffd36442e58e5ab8b1d1b083d15 (patch) | |
| tree | 69100185fb18d855359d6c2beccc12deda36ccfb /src/main.rs | |
| parent | b31e16554ccc95b1f6996aa3573a8036132da3a4 (diff) | |
queue: highlight current playing song initially
Diffstat (limited to 'src/main.rs')
| -rwxr-xr-x | src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 0b856b4..17fd053 100755 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,11 @@ fn main() -> AppResult<()> { // initial directory read app.browser.update_directory(&mut app.conn)?; + // initially set the queue's highlighted item to the current playing item + if let Ok(item) = app.conn.conn.currentsong() { + app.queue_list.index = item.unwrap_or_default().place.unwrap_or_default().pos as usize; + } + while app.running { tui.draw(&mut app)?; match tui.events.next()? { |
