Commit 37945473 authored by Xiaowu Zhang's avatar Xiaowu Zhang

fix playlist length bug

parent 587b48f2
...@@ -197,9 +197,13 @@ ...@@ -197,9 +197,13 @@
.push(function (e) { .push(function (e) {
var list = e.data.rows, var list = e.data.rows,
id; id;
if (list.length === 1) {
id = g.currentId;
} else {
do { do {
id = list[Math.floor(Math.random() * list.length)].id; id = list[Math.floor(Math.random() * list.length)].id;
} while (g.currentId === id); } while (g.currentId === id);
}
return g.displayThisPage({page: "control", return g.displayThisPage({page: "control",
id : id}); id : id});
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment