aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2024-05-31 12:51:06 +0530
committerkrolxon <krolyxon@tutanota.com>2024-05-31 12:51:06 +0530
commit311cbc26318ef81e1b7c697e11098fb6b642fd2c (patch)
tree70361bbb141f6f835ab29ad6c496cfdaecb1cf40 /src
parentdef91deabea041a80260d5ca38ea7ff6765ceeb2 (diff)
workaround for #7, fix error when using 'Space'
Diffstat (limited to 'src')
-rwxr-xr-xsrc/app.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/app.rs b/src/app.rs
index 491112f..a76d0cd 100755
--- a/src/app.rs
+++ b/src/app.rs
@@ -139,15 +139,17 @@ impl App {
}
if !status {
- 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 mut filename = format!("{}/{}", self.browser.path, content);
+
+ // Remove "./" from the beginning of filename
+ filename.remove(0);
+ filename.remove(0);
+
+ let song = self.conn.get_song_with_only_filename(&filename);
self.conn.conn.push(&song)?;
+
+ // updating queue, to avoid multiple pushes of the same songs if we enter multiple times before the queue gets updated
+ self.update_queue();
}
}