webmusic.js: skip folders
This commit is contained in:
parent
39f8df6ae9
commit
4db20d159a
12
webmusic.js
12
webmusic.js
|
@ -24,6 +24,10 @@ window.onkeyup = function (event) {
|
||||||
case " ":
|
case " ":
|
||||||
case "p":
|
case "p":
|
||||||
if (gstate == "idle" && total !== 0) {
|
if (gstate == "idle" && total !== 0) {
|
||||||
|
if (document.getElementById(index).classList.contains('dir')) {
|
||||||
|
return nextTrack();
|
||||||
|
}
|
||||||
|
|
||||||
playSong(index)
|
playSong(index)
|
||||||
} else {
|
} else {
|
||||||
togglePlayback();
|
togglePlayback();
|
||||||
|
@ -187,6 +191,10 @@ function updateState() {
|
||||||
function previousTrack() {
|
function previousTrack() {
|
||||||
if (index-- === 0) index = total-1;
|
if (index-- === 0) index = total-1;
|
||||||
|
|
||||||
|
if (document.getElementById(index).classList.contains('dir')) {
|
||||||
|
return previousTrack();
|
||||||
|
}
|
||||||
|
|
||||||
if (continuelist) {
|
if (continuelist) {
|
||||||
playSong(index)
|
playSong(index)
|
||||||
}
|
}
|
||||||
|
@ -195,6 +203,10 @@ function previousTrack() {
|
||||||
function nextTrack() {
|
function nextTrack() {
|
||||||
if (++index === total) index = 0;
|
if (++index === total) index = 0;
|
||||||
|
|
||||||
|
if (document.getElementById(index).classList.contains('dir')) {
|
||||||
|
return nextTrack();
|
||||||
|
}
|
||||||
|
|
||||||
if (continuelist) {
|
if (continuelist) {
|
||||||
playSong(index)
|
playSong(index)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue