mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added support for info from soundcloud on next_song info
This commit is contained in:
@@ -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();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user