From d979c47f509abeecae1015fb0ca2c294bcfdad83 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 12 May 2023 20:46:45 +0000 Subject: [PATCH] optimize clearTimeout + always shrink upload panes after completion + fix GET alignment --- copyparty/httpcli.py | 2 +- copyparty/web/browser.js | 5 ++++- copyparty/web/up2k.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 0406e9bd..fcce03b8 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -726,7 +726,7 @@ class HttpCli(object): def handle_get(self) -> bool: if self.do_log: - logmsg = "%4s %s @%s" % (self.mode, self.req, self.uname) + logmsg = "%-4s %s @%s" % (self.mode, self.req, self.uname) if "range" in self.headers: try: diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 0964bf0b..ddb1340a 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1974,7 +1974,10 @@ var pbar = (function () { w = 8, apos, adur; - clearTimeout(t_redraw); + if (t_redraw) { + clearTimeout(t_redraw); + t_redraw = 0; + } pctx.clearRect(0, 0, pc.w, pc.h); if (!mp || !mp.au || !isNum(adur = mp.au.duration) || !isNum(apos = mp.au.currentTime) || apos < 0 || adur < apos) diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 2292d511..441a1146 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1826,7 +1826,7 @@ function up2k_init(subtle) { timer.rm(etafun); timer.rm(donut.do); - utw_minh = 0; + utw_minh = utw_read = 0; } function chill(t) {