From 3f6b2bfefd54a53e675e0cffc98b704d3b8ad244 Mon Sep 17 00:00:00 2001 From: krolxon Date: Wed, 24 Apr 2024 12:52:32 +0530 Subject: Fix wrong songs playing when queue is not empty if we are playing a song which is in the middle of somewhere in queue. it will play the wrong song, since the index points to wrong song --- src/list.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/list.rs') diff --git a/src/list.rs b/src/list.rs index d5d5524..452907d 100755 --- a/src/list.rs +++ b/src/list.rs @@ -27,7 +27,9 @@ impl ContentList { /// Go to previous item in list pub fn prev(&mut self) { - if self.index != 0 { + if self.index == 0 { + self.index = self.list.len() - 1; + } else { self.index -= 1; } } -- cgit v1.2.3