aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2024-04-24 12:52:32 +0530
committerkrolxon <krolyxon@tutanota.com>2024-04-24 12:52:32 +0530
commit3f6b2bfefd54a53e675e0cffc98b704d3b8ad244 (patch)
tree0a94c5b91cf6c2f57bddec3df24a63b5ec6b9c6c /src/app.rs
parentbf11d5967fd52453292e8a5a0d9a0c618a03c4ad (diff)
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
Diffstat (limited to 'src/app.rs')
-rwxr-xr-xsrc/app.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/app.rs b/src/app.rs
index 1e0e8e2..dddcd75 100755
--- a/src/app.rs
+++ b/src/app.rs
@@ -12,7 +12,6 @@ pub struct App {
/// check if app is running
pub running: bool,
pub conn: Connection,
- pub play_deque: ContentList<String>,
pub song_list: ContentList<String>,
pub queue_list: ContentList<String>,
pub pl_list: ContentList<String>,
@@ -21,11 +20,11 @@ pub struct App {
impl App {
pub fn builder(addrs: &str) -> AppResult<Self> {
let mut conn = Connection::new(addrs).unwrap();
- let mut queue = ContentList::new();
+ let mut queue_list = ContentList::new();
let mut pl_list = ContentList::new();
pl_list.list = Self::get_playlist(&mut conn.conn)?;
- Self::get_queue(&mut conn, &mut queue.list);
+ Self::get_queue(&mut conn, &mut queue_list.list);
let mut song_list = ContentList::new();
song_list.list = conn.songs_filenames.clone();
@@ -33,9 +32,8 @@ impl App {
Ok(Self {
running: true,
conn,
- play_deque: ContentList::new(),
song_list,
- queue_list: ContentList::new(),
+ queue_list,
pl_list,
})
}