mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added skip for rate-limit reached on soundcloud
This commit is contained in:
@@ -271,7 +271,7 @@ function change_song(coll, error, id, conf, callback, socket) {
|
||||
$limit:2
|
||||
}], function(err, now_playing_doc){
|
||||
if((id && id == now_playing_doc[0].id) || !id) {
|
||||
if(error){
|
||||
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) {
|
||||
if (err || response.statusCode == 404) {
|
||||
db.collection(coll).remove({now_playing:true, id:id}, function(err, docs){
|
||||
|
||||
@@ -347,6 +347,12 @@ var Player = {
|
||||
}).catch(function(e){
|
||||
});
|
||||
}
|
||||
}).catch(function(error) {
|
||||
curr_playing = id;
|
||||
emit("skip", {error: 5, id: id, channel: chan.toLowerCase()});
|
||||
setTimeout(function() {
|
||||
toast("Seems the SoundCloud-API rate-limit has been reached..", "red lighten");
|
||||
}, 1000);
|
||||
});
|
||||
} else {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user