~hristoast/mousikofidi

d360cea8036359413e41fd1ad1d8ccacc384a53e — Hristos N. Triantafillou 8 months ago 0657520
Allow "next" when it's the "last" track but shuffled (#142)
1 files changed, 10 insertions(+), 2 deletions(-)

M mousikofidi/static/js/player.js
M mousikofidi/static/js/player.js => mousikofidi/static/js/player.js +10 -2
@@ 416,8 416,16 @@ function skipTrack(target, mediaType, doCmd) {

    var trackTotal = t.length - 1;

    if ((!repeatAll) && (cmd === "fwd") && (Number(currentTrack) === trackTotal))
        return;
    if ((!repeatAll) && (cmd === "fwd")) {
        if (shuffle) {
            // Don't allow a next if there are no more tracks left in the shuffled list.
            if (orderHolder.getAttribute("data-randorder") === "")
                return;

        } else if (Number(currentTrack) === trackTotal) {
            return;
        }
    }

    if ((shuffle === "on") || (shuffleMobile === "on")) {
        var randOrderString = orderHolder.getAttribute("data-randorder");