diff --git a/data/nodes.json b/data/nodes.json index 1bb21c7..d98aece 100644 --- a/data/nodes.json +++ b/data/nodes.json @@ -1,8 +1,8 @@ [ { - "host": "lava2.horizxon.studio", - "password": "horizxon.studio", + "host": "lava1.horizxon.studio", "port": 80, - "secure": false + "password": "horizxon.studio", + "retryAmount": 1 } ] \ No newline at end of file diff --git a/package.json b/package.json index 0006c5e..86bcb92 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "subsonics-web", "author": "Raphix", - "version": "0.9.2", + "version": "0.9.3", "nodemonConfig": { "ext": "js, html", "ignore": [ diff --git a/src/modules/sub-list.js b/src/modules/sub-list.js index 32e763e..4723254 100644 --- a/src/modules/sub-list.js +++ b/src/modules/sub-list.js @@ -178,6 +178,22 @@ module.exports.List = class { } + async replaceList(data) { + + var newOrder = new Array() + + for(var numOrder of data) { + parseInt(numOrder) + + newOrder.push(next[numOrder]) + + + } + next = newOrder + process.emit("MUSIC_UPDATE_STATE") + + } + async fpPlaylistAdd(playlist, client) { let player = client.manager.players.get("137291455336022018") @@ -252,10 +268,18 @@ module.exports.List = class { let player = client.manager.players.get("137291455336022018") if(!player) { + + var channelId = discord.getMemberVoices().get(userId) + + if(!channelId) { + + channelId = "664355808250953739" + } + player = client.manager.create({ guild: "137291455336022018", - voiceChannel: discord.getMemberVoices().get(userId), + voiceChannel: channelId, textChannel: "664355637685256203", }); @@ -280,4 +304,5 @@ module.exports.List = class { } -} \ No newline at end of file +} + diff --git a/src/modules/sub-web.js b/src/modules/sub-web.js index c133a63..4d71337 100644 --- a/src/modules/sub-web.js +++ b/src/modules/sub-web.js @@ -790,10 +790,38 @@ function IOConnection(io) { } else { - io.emit("ANSWER/SEND/DELETE_QUEUE", {"error":"USER_DONT_EXIST"}) + io.emit("ANSWER/SEND/MOVE_QUEUE", {"error":"USER_DONT_EXIST"}) } } else { - io.emit("ANSWER/SEND/DELETE_QUEUE", {"error":"TOKEN_NOT_FINDED"}) + io.emit("ANSWER/SEND/MOVE_QUEUE", {"error":"TOKEN_NOT_FINDED"}) + + } + + + + }) + + socket.on("SEND/MOVE_QUEUE_BY_ENTIRE", (data) => { + + + var cookies = socket.handshake.headers.cookie + + if(cookies) { + + cookies = cook.parse(cookies) + var token = cookies.token + + if(auth.checkUser(token)) { + + var sublist = new List() + sublist.replaceList(data) + + } else { + + io.emit("ANSWER/SEND/MOVE_QUEUE_BY_ENTIRE", {"error":"USER_DONT_EXIST"}) + } + } else { + io.emit("ANSWER/SEND/MOVE_QUEUE_BY_ENTIRE", {"error":"TOKEN_NOT_FINDED"}) } diff --git a/src/web/public/javascript/__index_script.js b/src/web/public/javascript/__index_script.js index 6a0d369..02dfb5f 100644 --- a/src/web/public/javascript/__index_script.js +++ b/src/web/public/javascript/__index_script.js @@ -1295,7 +1295,13 @@ socket.on("/ALWAYS/MUSIC_STATE", (data) => { queueNum += 1 console.log(queueNum) console.log(data.queue.indexOf(title) + " - " + title.title) - contentToPush.push('
' + title.title + '
' + title.title + '