rmptui5b6a79c
assert filenames instead of seeing if it contains
+6 −2
2 files changed
- M src/app.rs +4 −1
- M src/ui.rs +2 −1
| @@ -190,7 +190,10 @@ impl App { | |||
| 190 | 190 | .queue_list | |
| 191 | 191 | .list | |
| 192 | 192 | .iter() | |
| 193 | − | .position(|x| x.file.contains(path)); | |
| 193 | + | .position(|x| { | |
| 194 | + | let file = x.file.split("/").last().unwrap(); | |
| 195 | + | file.eq(path) | |
| 196 | + | }); | |
| 194 | 197 | ||
| 195 | 198 | if index.is_some() { | |
| 196 | 199 | self.conn.conn.switch(index.unwrap() as u32)?; | |
| @@ -76,7 +76,8 @@ fn draw_directory_browser(frame: &mut Frame, app: &mut App, size: Rect) { | |||
| 76 | 76 | ||
| 77 | 77 | let mut status: bool = false; | |
| 78 | 78 | for sn in app.queue_list.list.iter() { | |
| 79 | − | if sn.file.contains(s) { | |
| 79 | + | let file = sn.file.split("/").last().unwrap(); | |
| 80 | + | if file.eq(s) { | |
| 80 | 81 | status = true; | |
| 81 | 82 | } | |
| 82 | 83 | } | |