From f1130db131fc393f65459411619204d6dd2f2e1a Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 4 Sep 2024 22:03:26 +0000 Subject: [PATCH] fix confusing message when uploading dupes due to deduplication, it is intentionally impossible to upload several identical copies of a file in parallel by default, the up2k client will upload files sorted by size, which usually leads to dupes being grouped together, and it will try to do just that this is by design, as it improves performance on average, but it also shows the confusing (but technically-correct) message "resume the partial upload into the original path" fix this with a more appropriate message note that this approach was selected in favor of pausing handshakes while the initial copy finishes uploading, because that could severely reduce upload performance by preventing optimal use of multiple connections --- copyparty/web/browser.js | 3 +++ copyparty/web/up2k.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 7ee15ba7..1a506f9d 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -493,6 +493,7 @@ var Ls = { "u_etaprep": '(preparing to upload)', "u_hashdone": 'hashing done', "u_hashing": 'hash', + "u_dupdefer": "duplicate; will be processed after all other files", "u_fixed": "OK!  Fixed it 👍", "u_cuerr": "failed to upload chunk {0} of {1};\nprobably harmless, continuing\n\nfile: {2}", "u_cuerr2": "server rejected upload (chunk {0} of {1});\nwill retry later\n\nfile: {2}\n\nerror ", @@ -1029,6 +1030,7 @@ var Ls = { "u_etaprep": '(forbereder opplastning)', "u_hashdone": 'befaring ferdig', "u_hashing": 'les', + "u_dupdefer": "duplikat; vil bli håndtert til slutt", "u_fixed": "OK!  Løste seg 👍", "u_cuerr": "kunne ikke laste opp del {0} av {1};\nsikkert greit, fortsetter\n\nfil: {2}", "u_cuerr2": "server nektet opplastningen (del {0} av {1});\nprøver igjen senere\n\nfil: {2}\n\nerror ", @@ -1565,6 +1567,7 @@ var Ls = { "u_etaprep": '(准备上传)', "u_hashdone": '哈希完成', "u_hashing": '哈希', + "u_dupdefer": "这是一个重复文件。它将在所有其他文件上传后进行处理", //m "u_fixed": "好! 已修复 👍", "u_cuerr": "上传块 {0} 的 {1} 失败;\n可能无害,继续中\n\n文件:{2}", "u_cuerr2": "服务器拒绝上传(块 {0} 的 {1});\n稍后重试\n\n文件:{2}\n\n错误 ", diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index b031973e..947d3a67 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -156,6 +156,7 @@ function U2pvis(act, btns, uc, st) { 'ERROR': 'ERROR', 'OS-error': 'OS-error', 'found': 'found', + 'defer': 'defer', 'YOLO': 'YOLO', 'done': 'done', }; @@ -2460,6 +2461,7 @@ function up2k_init(subtle) { pvis.seth(t.n, 2, L.u_ehstmp, t); var err = "", + cls = "ERROR", rsp = unpre(xhr.responseText), ofs = rsp.lastIndexOf('\nURL: '); @@ -2489,6 +2491,8 @@ function up2k_init(subtle) { if (!t.rechecks && (err_pend || err_srcb)) { t.rechecks = 0; t.want_recheck = true; + err = L.u_dupdefer; + cls = 'defer'; } } if (rsp.indexOf('server HDD is full') + 1) @@ -2498,7 +2502,7 @@ function up2k_init(subtle) { if (!t.t_uploading) st.bytes.finished += t.size; - pvis.seth(t.n, 1, "ERROR"); + pvis.seth(t.n, 1, cls); pvis.seth(t.n, 2, err); pvis.move(t.n, 'ng');