mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 08:21:59 +02:00
Do not check Ids length in shuffle repeat mode
We always have at least 2 playlist items, thus at least 1 Id in array when we reach this point in code
This commit is contained in:
@@ -192,7 +192,8 @@ class ClapperPlaylistWidget extends Gtk.ListBox
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(playlistIds.length) {
|
/* We always have non-empty array here,
|
||||||
|
* otherwise seek to beginning is performed */
|
||||||
const randomId = playlistIds[
|
const randomId = playlistIds[
|
||||||
Math.floor(Math.random() * playlistIds.length)
|
Math.floor(Math.random() * playlistIds.length)
|
||||||
];
|
];
|
||||||
@@ -200,13 +201,6 @@ class ClapperPlaylistWidget extends Gtk.ListBox
|
|||||||
|
|
||||||
return this.changeActiveRow(randomId);
|
return this.changeActiveRow(randomId);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
debug('only one playlist item, playing again');
|
|
||||||
|
|
||||||
player.seek(0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.nextTrack())
|
if(this.nextTrack())
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user