mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
etter response on empty-list skip-try, and add log for debugging when server crashes on change_song
This commit is contained in:
@@ -141,7 +141,10 @@ function skip(list, guid, coll, offline, socket, callback) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!list.hasOwnProperty("id") || list.id == undefined) {
|
||||||
|
socket.emit('toast', "The list is empty.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(!list.hasOwnProperty("id") || !list.hasOwnProperty("channel") ||
|
if(!list.hasOwnProperty("id") || !list.hasOwnProperty("channel") ||
|
||||||
(typeof(list.id) != "string" && typeof(list.id) != "number") || typeof(list.channel) != "string") {
|
(typeof(list.id) != "string" && typeof(list.id) != "number") || typeof(list.channel) != "string") {
|
||||||
var result = {
|
var result = {
|
||||||
@@ -299,6 +302,9 @@ function change_song(coll, error, id, conf, callback, socket) {
|
|||||||
}, {
|
}, {
|
||||||
$limit:2
|
$limit:2
|
||||||
}], function(err, now_playing_doc){
|
}], function(err, now_playing_doc){
|
||||||
|
if(now_playing_doc.length == 0) {
|
||||||
|
console.log("empty list", coll, callback, id, conf);
|
||||||
|
}
|
||||||
if(now_playing_doc.length > 0 && ((id && id == now_playing_doc[0].id) || !id)) {
|
if(now_playing_doc.length > 0 && ((id && id == now_playing_doc[0].id) || !id)) {
|
||||||
if(error && now_playing_doc[0].source == "youtube"){
|
if(error && now_playing_doc[0].source == "youtube"){
|
||||||
request('http://img.youtube.com/vi/'+now_playing_doc[0].id+'/mqdefault.jpg', function (err, response, body) {
|
request('http://img.youtube.com/vi/'+now_playing_doc[0].id+'/mqdefault.jpg', function (err, response, body) {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li class="chat-toggle-li hide">
|
||||||
<span class="switch-text">
|
<span class="switch-text">
|
||||||
Strict skip
|
Strict skip
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user