aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/Main.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2025-05-19 03:06:41 +0300
committerRblSb <msrblsb@gmail.com>2025-05-24 13:59:03 +0300
commit623d85f88bb42834b335801ad5d703f6945d38d2 (patch)
tree857983c5c90f429e4764e4880f95d8f12a0f4595 /src/server/Main.hx
parent4b48de4f824ce48f1466014a9e9aa24023212181 (diff)
Migrate to yt-dlp
- yt-dlp should be more stable and allows more cool stuff in future - easier to export cookies.txt with yt-dlp utility (cookies.json support removed) - better quality fallback if not enough space - keep progress reports after reconnections
Diffstat (limited to 'src/server/Main.hx')
-rw-r--r--src/server/Main.hx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/Main.hx b/src/server/Main.hx
index 8164922..3cde049 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -58,7 +58,9 @@ class Main {
public final clients:Array<Client> = [];
final freeIds:Array<Int> = [];
+ #if !display
final wsEventParser = new JsonParser<WsEvent>();
+ #end
final consoleInput:ConsoleInput;
final cache:Cache;
final cacheDir:String;
@@ -960,6 +962,7 @@ class Main {
serverMessage(client, "Free space: "
+ (cache.getFreeSpace() / 1024).toFixed()
+ "KiB");
+ serverMessage(client, "Memory usage: " + js.Node.process.memoryUsage());
send(client, {
type: Dump,
dump: {
@@ -1006,6 +1009,11 @@ class Main {
client.ws.send(jsonStringify(data), null);
}
+ public function sendByName(clientName:String, data:WsEvent):Void {
+ final client = clients.getByName(clientName) ?? return;
+ client.ws.send(jsonStringify(data), null);
+ }
+
public function broadcast(data:WsEvent):Void {
final json = jsonStringify(data);
for (client in clients)
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage