aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Main.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Main.hx')
-rw-r--r--src/client/Main.hx23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/client/Main.hx b/src/client/Main.hx
index e7f8f30..abc39f6 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -27,7 +27,7 @@ import js.html.WebSocket;
class Main {
public static var instance(default, null):Main;
- static inline var SETTINGS_VERSION = 5;
+ static inline var SETTINGS_VERSION = 6;
static inline var MAX_CHAT_MESSAGES = 200;
public final settings:ClientSettings;
@@ -81,8 +81,6 @@ class Main {
uuid: null,
name: "",
hash: "",
- isExtendedPlayer: false,
- playerSize: 1,
chatSize: 300,
synchThreshold: 2,
isSwapped: false,
@@ -92,6 +90,7 @@ class Main {
hotkeysEnabled: true,
showHintList: true,
checkboxes: [],
+ checkedCache: [],
}
Settings.init(defaults, settingsPatcher);
settings = Settings.read();
@@ -139,6 +138,16 @@ class Main {
case 4:
final data:ClientSettings = data;
data.checkboxes = [];
+ case 5:
+ final data:ClientSettings = data;
+ data.checkedCache = [];
+ Reflect.deleteField(data, "playerSize");
+ Reflect.deleteField(data, "isExtendedPlayer");
+ final oldCheck = data.checkboxes.find(item -> item.id == "cache-on-server");
+ if (oldCheck != null) {
+ data.checkboxes.remove(oldCheck);
+ data.checkedCache.push(YoutubeType);
+ }
case SETTINGS_VERSION, _:
throw 'skipped version $version';
}
@@ -307,6 +316,14 @@ class Main {
return player.isSingleVideoUrl(url);
}
+ public function isExternalVideoUrl(url:String):Bool {
+ url = url.ltrim();
+ if (url.startsWith("/")) return false;
+ final host = Browser.location.hostname;
+ if (url.contains(host)) return false;
+ return true;
+ }
+
public function sortItemsForQueueNext<T>(items:Array<T>):Void {
if (items.length == 0) return;
// except first item when list empty
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage