-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -493,9 +493,14 @@ class Queue<T = unknown> { | |
*/ | ||
jump(track: Track | number): void { | ||
if (this.#watchDestroyed()) return; | ||
// remove the track if exists | ||
const foundTrack = this.remove(track); | ||
if (!foundTrack) throw new PlayerError("Track not found", ErrorStatusCode.TRACK_NOT_FOUND); | ||
this.tracks.splice(0, 0, foundTrack); | ||
// since we removed the existing track from the queue, | ||
// we now have to place that to position 1 | ||
// because we want to jump to that track | ||
// this will skip current track and play the next one which will be the foundTrack | ||
this.tracks.splice(1, 0, foundTrack); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Samiul30
Contributor
|
||
|
||
return void this.skip(); | ||
} | ||
|
This broke jump again.
The current song is not included in the queue, so index 0 is the song that is played next not index 1.