From 97bad11001aeb299e0e8c339af77368e065d215d Mon Sep 17 00:00:00 2001 From: RblSb Date: Wed, 20 May 2020 14:47:12 +0300 Subject: Fix server video skip for guests --- build/server.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'build/server.js') diff --git a/build/server.js b/build/server.js index bc54fbb..02b5503 100644 --- a/build/server.js +++ b/build/server.js @@ -3637,7 +3637,7 @@ server_Main.prototype = { if(_gthis.videoList.length != currentLength) { return; } - _gthis.onMessage(client,{ type : "SkipVideo", skipVideo : { url : _gthis.videoList[_gthis.itemPos].url}}); + _gthis.skipVideo({ type : "SkipVideo", skipVideo : { url : _gthis.videoList[_gthis.itemPos].url}}); },1000); return; } @@ -3859,17 +3859,7 @@ server_Main.prototype = { if(!this.checkPermission(client,"removeVideo")) { return; } - if(this.videoList.length == 0) { - return; - } - if(this.videoList[this.itemPos].url != data.skipVideo.url) { - return; - } - this.itemPos = VideoList.skipItem(this.videoList,this.itemPos); - if(this.videoList.length > 0) { - this.restartWaitTimer(); - } - this.broadcast(data); + this.skipVideo(data); break; case "ToggleItemType": VideoList.toggleItemType(this.videoList,data.toggleItemType.pos); @@ -3928,6 +3918,19 @@ server_Main.prototype = { client.ws.send(json,null); } } + ,skipVideo: function(data) { + if(this.videoList.length == 0) { + return; + } + if(this.videoList[this.itemPos].url != data.skipVideo.url) { + return; + } + this.itemPos = VideoList.skipItem(this.videoList,this.itemPos); + if(this.videoList.length > 0) { + this.restartWaitTimer(); + } + this.broadcast(data); + } ,checkPermission: function(client,perm) { var state = this.hasPermission(client,perm); if(!state) { -- cgit v1.2.3