workaround for #7
This commit is contained in:
parent
48fd5a7508
commit
b31e16554c
17
src/app.rs
17
src/app.rs
|
|
@ -117,12 +117,16 @@ impl App {
|
||||||
let songs = self.conn.conn.listfiles(&file).unwrap_or_default();
|
let songs = self.conn.conn.listfiles(&file).unwrap_or_default();
|
||||||
for (t, f) in songs.iter() {
|
for (t, f) in songs.iter() {
|
||||||
if t == "file" {
|
if t == "file" {
|
||||||
if let Some(full_path) = &self.conn.get_full_path(f) {
|
let path = self.browser.prev_path.to_string()
|
||||||
|
+ "/"
|
||||||
|
+ self.browser.path.as_str()
|
||||||
|
+ "/"
|
||||||
|
+ f;
|
||||||
|
let full_path = path.strip_prefix("./").unwrap_or_else(|| "");
|
||||||
let song = self.conn.get_song_with_only_filename(full_path);
|
let song = self.conn.get_song_with_only_filename(full_path);
|
||||||
self.conn.conn.push(&song)?;
|
self.conn.conn.push(&song)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if content_type == "file" {
|
} else if content_type == "file" {
|
||||||
let mut status = false;
|
let mut status = false;
|
||||||
for (i, song) in self.queue_list.list.clone().iter().enumerate() {
|
for (i, song) in self.queue_list.list.clone().iter().enumerate() {
|
||||||
|
|
@ -134,12 +138,17 @@ impl App {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !status {
|
if !status {
|
||||||
if let Some(full_path) = &self.conn.get_full_path(content) {
|
let path = self.browser.prev_path.to_string()
|
||||||
|
+ "/"
|
||||||
|
+ self.browser.path.as_str()
|
||||||
|
+ "/"
|
||||||
|
+ content;
|
||||||
|
let full_path = path.strip_prefix("./").unwrap_or_else(|| "");
|
||||||
|
|
||||||
let song = self.conn.get_song_with_only_filename(full_path);
|
let song = self.conn.get_song_with_only_filename(full_path);
|
||||||
self.conn.conn.push(&song)?;
|
self.conn.conn.push(&song)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Highlight next row if possible
|
// Highlight next row if possible
|
||||||
if self.browser.selected != self.browser.filetree.len() - 1 {
|
if self.browser.selected != self.browser.filetree.len() - 1 {
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,10 @@ impl FileBrowser {
|
||||||
let v = conn
|
let v = conn
|
||||||
.conn
|
.conn
|
||||||
.lsinfo(Song {
|
.lsinfo(Song {
|
||||||
file: conn
|
file: (self.path.clone() + "/" + song)
|
||||||
.get_full_path(song)
|
.strip_prefix("./")
|
||||||
.unwrap_or_else(|| "Not a song".to_string()),
|
.unwrap_or_else(|| "")
|
||||||
|
.to_string(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|_| {
|
.unwrap_or_else(|_| {
|
||||||
|
|
|
||||||
Reference in New Issue