reoptimized where to set the initial random song
This commit is contained in:
@@ -105,7 +105,7 @@
|
||||
return;
|
||||
|
||||
if (g_previous_idx >= (g_previous.length - 1)) {
|
||||
if (g_shuffle || g_current === -1) {
|
||||
if (g_shuffle) {
|
||||
g_current = Math.floor (Math.random () * g_playlist.length);
|
||||
}
|
||||
else {
|
||||
@@ -188,6 +188,9 @@
|
||||
if (elements.length > 0) {
|
||||
elements[0].click ();
|
||||
} else {
|
||||
if (g_current === -1) {
|
||||
g_current = Math.floor (Math.random () * g_playlist.length);
|
||||
}
|
||||
playNextTrack ();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user