Added support for info from soundcloud on next_song info

This commit is contained in:
Kasper Rynning-Tønnesen
2018-05-04 20:50:26 +02:00
parent 2afb6ea64f
commit 4557430ac2

View File

@@ -682,7 +682,13 @@ function getNextSong(coll, callback) {
$limit:1 $limit:1
}], function(err, doc) { }], function(err, doc) {
if(doc.length == 1) { if(doc.length == 1) {
io.to(coll).emit("next_song", {videoId: doc[0].id, title: doc[0].title}); var thumbnail = "";
var source = "youtube";
if(doc[0].source && doc[0].source == "soundcloud") {
source = "soundcloud";
thumbnail = doc[0].thumbnail;
}
io.to(coll).emit("next_song", {videoId: doc[0].id, title: doc[0].title, source: source, thumbnail: thumbnail});
} }
if(typeof(callback) == "function") callback(); if(typeof(callback) == "function") callback();
}); });