rmptui9922b1c
workaround for #7, fix error when using 'Space'
+10 −8
1 file changed
- M src/app.rs +10 −8
| @@ -139,15 +139,17 @@ impl App { | |||
| 139 | 139 | } | |
| 140 | 140 | ||
| 141 | 141 | if !status { | |
| 142 | − | let path = self.browser.prev_path.to_string() | |
| 143 | − | + "/" | |
| 144 | − | + self.browser.path.as_str() | |
| 145 | − | + "/" | |
| 146 | − | + content; | |
| 147 | − | let full_path = path.strip_prefix("././").unwrap_or_else(|| ""); | |
| 148 | − | ||
| 149 | − | let song = self.conn.get_song_with_only_filename(full_path); | |
| 142 | + | let mut filename = format!("{}/{}", self.browser.path, content); | |
| 143 | + | ||
| 144 | + | // Remove "./" from the beginning of filename | |
| 145 | + | filename.remove(0); | |
| 146 | + | filename.remove(0); | |
| 147 | + | ||
| 148 | + | let song = self.conn.get_song_with_only_filename(&filename); | |
| 150 | 149 | self.conn.conn.push(&song)?; | |
| 150 | + | ||
| 151 | + | // updating queue, to avoid multiple pushes of the same songs if we enter multiple times before the queue gets updated | |
| 152 | + | self.update_queue(); | |
| 151 | 153 | } | |
| 152 | 154 | } | |
| 153 | 155 | ||