mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Testing out different request
This commit is contained in:
@@ -660,9 +660,11 @@ function change_song(coll, error)
|
||||
console.log("err: " + err);
|
||||
console.log("error: " + error);
|
||||
console.log("now_playing_doc: " + now_playing_doc);
|
||||
request('http://img.youtube.com/vi/'+now_playing_doc[0].id+'/mqdefault.jpg', function (err, response, body) {
|
||||
console.log("request: " + request);
|
||||
request.get('http://img.youtube.com/vi/'+now_playing_doc[0].id+'/mqdefault.jpg')
|
||||
.on('response', function (response) {
|
||||
console.log(response);
|
||||
if (err || response.statusCode == 404) {
|
||||
if (response.statusCode == 404) {
|
||||
db.collection(coll).remove({now_playing:true}, function(err, docs){
|
||||
change_song_post(coll);
|
||||
io.to(coll).emit("channel", ["deleted", now_playing_doc[0].id]);
|
||||
|
||||
Reference in New Issue
Block a user