diff options
| author | RblSb <msrblsb@gmail.com> | 2025-01-16 03:07:31 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2025-01-17 01:00:09 +0300 |
| commit | d9ca7beaa9494cf34590853901cf8be44e243775 (patch) | |
| tree | f09ce979460bdf28363a922298283dfee0c506fb /src/Types.hx | |
| parent | f84fdc40ba817b6a2d907484b1e1500197ceeafe (diff) | |
Cache on server feature
Server will download video from supported players and add as raw video to playlist (only youtube is supported for now).
Cache for YT player is available after installing optional dependencies, see readme. For cache size see `cacheStorageLimitGiB ` in config.
There is also minor ux improvement, latest checkbox states will be keeped in local storage now.
Diffstat (limited to 'src/Types.hx')
| -rw-r--r-- | src/Types.hx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/Types.hx b/src/Types.hx index 8567f7b..0f56392 100644 --- a/src/Types.hx +++ b/src/Types.hx @@ -1,7 +1,12 @@ package; import Client.ClientData; -import utils.YoutubeUtils.YouTubeVideoInfo; + +enum abstract PlayerType(String) { + var RawType; + var YoutubeType; + var IframeType; +} typedef VideoDataRequest = { final url:String; @@ -14,7 +19,7 @@ typedef VideoData = { var ?url:String; var ?subs:String; var ?voiceOverTrack:String; - var ?isIframe:Bool; + var ?playerType:PlayerType; } typedef Config = { @@ -32,6 +37,7 @@ typedef Config = { templateUrl:String, youtubeApiKey:String, youtubePlaylistLimit:Int, + cacheStorageLimitGiB:Float, permissions:Permissions, emotes:Array<Emote>, filters:Array<Filter>, @@ -109,7 +115,8 @@ typedef VideoItem = { var ?subs:String; var ?voiceOverTrack:String; var isTemp:Bool; - var isIframe:Bool; + var doCache:Bool; + var playerType:PlayerType; } private class VideoItemTools { @@ -122,7 +129,8 @@ private class VideoItemTools { subs: item.subs, voiceOverTrack: item.voiceOverTrack, isTemp: item.isTemp, - isIframe: item.isIframe + doCache: item.doCache, + playerType: item.playerType }; } } @@ -145,7 +153,8 @@ typedef WsEvent = { videoList:Array<VideoItem>, isPlaylistOpen:Bool, itemPos:Int, - globalIp:String + globalIp:String, + playersCacheSupport:Array<PlayerType>, }, ?login:{ clientName:String, @@ -226,10 +235,6 @@ typedef WsEvent = { ?dump:{ data:String }, - ?getYoutubeVideoInfo:{ - url:String, - ?response:YouTubeVideoInfo - } } enum abstract WsEventType(String) { @@ -267,5 +272,4 @@ enum abstract WsEventType(String) { var UpdatePlaylist; var TogglePlaylistLock; var Dump; - var GetYoutubeVideoInfo; } |
