Skip to content

Commit

Permalink
Fix song promote (fixes #30)
Browse files Browse the repository at this point in the history
Updated player.rs to move songs to front of queue instead of swapping.
  • Loading branch information
Jerome Quah committed Apr 20, 2019
1 parent d0481ac commit 1e4e711
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bot/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,9 @@ impl Queue {
return None;
}

q.swap(0, n);
if let Some(removed) = q.remove(n) {
q.push_front(removed);
}

if let Some(item) = q.get(0).cloned() {
self.db.promote_song_log(user, &item.track_id);
Expand Down

0 comments on commit 1e4e711

Please sign in to comment.