Commit 37945473 authored by Xiaowu Zhang's avatar Xiaowu Zhang

fix playlist length bug

parent 587b48f2
......@@ -197,9 +197,13 @@
.push(function (e) {
var list = e.data.rows,
id;
do {
id = list[Math.floor(Math.random() * list.length)].id;
} while (g.currentId === id);
if (list.length === 1) {
id = g.currentId;
} else {
do {
id = list[Math.floor(Math.random() * list.length)].id;
} while (g.currentId === id);
}
return g.displayThisPage({page: "control",
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