pl_append remove get_full_path() usage of Queue #7

This commit is contained in:
krolxon 2024-05-31 12:36:41 +05:30
parent 7b14b68164
commit def91deabe
1 changed files with 9 additions and 10 deletions

View File

@ -24,11 +24,9 @@ pub fn hande_pl_append_keys(key_event: KeyEvent, app: &mut App) -> AppResult<()>
return Ok(());
}
let short_path = &app.queue_list.get_item_at_current_index().file;
if let Some(full_path) = app.conn.get_full_path(short_path) {
let song = app.conn.get_song_with_only_filename(&full_path);
if let Ok(songs) = app.conn.conn.songs(app.queue_list.index as u32) {
let option_song = songs.first();
if let Some(song) = option_song {
if *pl_name == "Current Playlist" {
app.conn.conn.push(&song)?;
app.update_queue();
@ -37,6 +35,7 @@ pub fn hande_pl_append_keys(key_event: KeyEvent, app: &mut App) -> AppResult<()>
}
}
}
}
SelectedTab::DirectoryBrowser => {
let (t, f) = app.browser.filetree.get(app.browser.selected).unwrap();