mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
fix infinite backspin on "previous track";
when playing the first track in a folder and hitting the previous track button, it would keep switching through the previous folders inifinitely
This commit is contained in:
parent
f3035e8869
commit
6f4bde2111
|
@ -2243,7 +2243,7 @@ function song_skip(n, dirskip) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tid)
|
if (tid && !dirskip)
|
||||||
play(ofs + n);
|
play(ofs + n);
|
||||||
else
|
else
|
||||||
play(mp.order[n == -1 ? mp.order.length - 1 : 0]);
|
play(mp.order[n == -1 ? mp.order.length - 1 : 0]);
|
||||||
|
@ -2276,6 +2276,21 @@ function next_song_cmn(e) {
|
||||||
mpl.traversals = 0;
|
mpl.traversals = 0;
|
||||||
t_fchg = 0;
|
t_fchg = 0;
|
||||||
}
|
}
|
||||||
|
function last_song(e) {
|
||||||
|
ev(e);
|
||||||
|
if (mp.order.length) {
|
||||||
|
mpl.traversals = 0;
|
||||||
|
return song_skip(-1, true);
|
||||||
|
}
|
||||||
|
if (mpl.traversals++ < 5) {
|
||||||
|
treectl.ls_cb = last_song;
|
||||||
|
return tree_neigh(-1);
|
||||||
|
}
|
||||||
|
toast.inf(10, L.mm_nof);
|
||||||
|
console.log("mm_nof2");
|
||||||
|
mpl.traversals = 0;
|
||||||
|
t_fchg = 0;
|
||||||
|
}
|
||||||
function prev_song(e) {
|
function prev_song(e) {
|
||||||
ev(e);
|
ev(e);
|
||||||
|
|
||||||
|
@ -2920,7 +2935,7 @@ function play(tid, is_ev, seek) {
|
||||||
tn = mp.order.length - 1;
|
tn = mp.order.length - 1;
|
||||||
}
|
}
|
||||||
else if (mpl.pb_mode == 'next') {
|
else if (mpl.pb_mode == 'next') {
|
||||||
treectl.ls_cb = prev_song;
|
treectl.ls_cb = last_song;
|
||||||
return tree_neigh(-1);
|
return tree_neigh(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue