From 4557430ac20da62b0cec4c0f2f096358790ca1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 4 May 2018 20:50:26 +0200 Subject: [PATCH] Added support for info from soundcloud on next_song info --- server/handlers/list.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/handlers/list.js b/server/handlers/list.js index f60dd451..f9ab8887 100644 --- a/server/handlers/list.js +++ b/server/handlers/list.js @@ -682,7 +682,13 @@ function getNextSong(coll, callback) { $limit:1 }], function(err, doc) { 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(); });