From 304bd1e77a5442f614aacd2b35f330777118b2cd Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Mon, 19 Oct 2026 15:32:53 -0700 Subject: merge with upstream https://github.com/RblSb/SyncTube --- src/Types.hx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/Types.hx') diff --git a/src/Types.hx b/src/Types.hx index 1b1997a..1e59e82 100644 --- a/src/Types.hx +++ b/src/Types.hx @@ -6,6 +6,7 @@ enum abstract PlayerType(String) { var RawType; var YoutubeType; var VkType; + var VimeoType; var IframeType; } @@ -36,6 +37,7 @@ typedef ServerConfig = Config & { localAdmins:Bool, allowProxyIps:Bool, localNetworkOnly:Bool, + enableCORS:Bool, sslKeyPemPath:String, sslCertPemPath:String, cacheStorageLimitGiB:Float, @@ -129,6 +131,7 @@ enum abstract ProgressType(String) { var Downloading; var Uploading; var Canceled; + var Completed; } @:using(Types.VideoItemTools) @@ -142,10 +145,17 @@ typedef VideoItem = { var ?voiceOverTrack:String; var isTemp:Bool; var doCache:Bool; + var ?isIncomplete:Bool; var playerType:PlayerType; } private class VideoItemTools { + public static function isPlayable(item:VideoItem):Bool { + // if item is uploading instead of caching, it's playable + if (item.isIncomplete == true && item.doCache) return false; + return true; + } + public static function withUrl(item:VideoItem, url:String):VideoItem { return { url: url, @@ -156,6 +166,7 @@ private class VideoItemTools { voiceOverTrack: item.voiceOverTrack, isTemp: item.isTemp, doCache: item.doCache, + isIncomplete: item.isIncomplete, playerType: item.playerType }; } @@ -210,6 +221,7 @@ typedef WsEvent = { ?progress:{ type:ProgressType, ratio:Float, + ?url:String, ?data:String }, ?updateClients:{ @@ -232,6 +244,11 @@ typedef WsEvent = { ?skipVideo:{ url:String }, + ?skipVideoStats:{ + voted:Int, + total:Int, + required:Int + }, ?pause:{ time:Float }, @@ -258,7 +275,8 @@ typedef WsEvent = { pos:Int }, ?toggleItemType:{ - pos:Int + pos:Int, + ?all:Bool }, ?updatePlaylist:{ videoList:Array @@ -287,6 +305,7 @@ enum abstract WsEventType(String) { var AddVideo; var RemoveVideo; var SkipVideo; + var SkipVideoStats; var VideoLoaded; var Pause; var Play; -- cgit v1.2.3