Add playlist support with marking and folder playback
- Mark files with 't' key (shown with * prefix in yellow) - Clear marks with 'c' key - Enter plays: marked files > whole folder > single file - Navigate playlist with 'n' (next) and 'p' (previous) - Show playlist position in status (e.g., "song.mp3 [3/10]") - Collect all files recursively when playing folder - Remove emoji icons from status panel - Update help text with new keybindings
This commit is contained in:
28
src/main.rs
28
src/main.rs
@@ -113,14 +113,28 @@ async fn handle_key_event(state: &mut AppState, key_code: KeyCode) -> Result<()>
|
||||
KeyCode::Char('l') => {
|
||||
state.expand_selected();
|
||||
}
|
||||
KeyCode::Char('t') => {
|
||||
state.toggle_mark();
|
||||
}
|
||||
KeyCode::Char('c') => {
|
||||
state.clear_marks();
|
||||
}
|
||||
KeyCode::Char('n') => {
|
||||
state.play_next();
|
||||
if let Some(ref path) = state.current_file {
|
||||
tracing::info!("Next track: {:?}", path);
|
||||
}
|
||||
}
|
||||
KeyCode::Char('p') => {
|
||||
state.play_previous();
|
||||
if let Some(ref path) = state.current_file {
|
||||
tracing::info!("Previous track: {:?}", path);
|
||||
}
|
||||
}
|
||||
KeyCode::Enter => {
|
||||
if let Some(item) = state.get_selected_item() {
|
||||
if !item.node.is_dir {
|
||||
let path = item.node.path.clone();
|
||||
state.current_file = Some(path.clone());
|
||||
state.player_state = PlayerState::Playing;
|
||||
tracing::info!("Playing: {:?}", path);
|
||||
}
|
||||
state.play_selection();
|
||||
if let Some(ref path) = state.current_file {
|
||||
tracing::info!("Playing: {:?} (playlist: {} tracks)", path, state.playlist.len());
|
||||
}
|
||||
}
|
||||
KeyCode::Char(' ') => {
|
||||
|
||||
Reference in New Issue
Block a user