From b31e16554ccc95b1f6996aa3573a8036132da3a4 Mon Sep 17 00:00:00 2001 From: krolxon Date: Sat, 25 May 2024 11:09:54 +0530 Subject: workaround for #7 --- src/app.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index 07cf9a7..6344799 100755 --- a/src/app.rs +++ b/src/app.rs @@ -117,10 +117,14 @@ impl App { let songs = self.conn.conn.listfiles(&file).unwrap_or_default(); for (t, f) in songs.iter() { if t == "file" { - if let Some(full_path) = &self.conn.get_full_path(f) { - let song = self.conn.get_song_with_only_filename(full_path); - self.conn.conn.push(&song)?; - } + 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); + self.conn.conn.push(&song)?; } } } else if content_type == "file" { @@ -134,10 +138,15 @@ impl App { } if !status { - if let Some(full_path) = &self.conn.get_full_path(content) { - let song = self.conn.get_song_with_only_filename(full_path); - self.conn.conn.push(&song)?; - } + 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); + self.conn.conn.push(&song)?; } } -- cgit v1.2.3