aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/Main.hx18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/server/Main.hx b/src/server/Main.hx
index e072774..d5e8be6 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -415,12 +415,7 @@ class Main {
case SkipVideo:
if (!checkPermission(client, RemoveVideoPerm)) return;
- if (videoList.length == 0) return;
- final item = videoList[itemPos];
- if (item.url != data.skipVideo.url) return;
- itemPos = videoList.skipItem(itemPos);
- if (videoList.length > 0) restartWaitTimer();
- broadcast(data);
+ skipVideo(data);
case Pause:
if (videoList.length == 0) return;
@@ -445,7 +440,7 @@ class Main {
final currentLength = videoList.length;
Timer.delay(() -> {
if (videoList.length != currentLength) return;
- onMessage(client, {
+ skipVideo({
type: SkipVideo, skipVideo: {
url: videoList[itemPos].url
}
@@ -611,6 +606,15 @@ class Main {
}
}
+ function skipVideo(data:WsEvent):Void {
+ if (videoList.length == 0) return;
+ final item = videoList[itemPos];
+ if (item.url != data.skipVideo.url) return;
+ itemPos = videoList.skipItem(itemPos);
+ if (videoList.length > 0) restartWaitTimer();
+ broadcast(data);
+ }
+
function checkPermission(client:Client, perm:Permission):Bool {
final state = hasPermission(client, perm);
if (!state) send(client, {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage