Skip to content

Commit f1130db

Browse files
committed
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
1 parent 735ec35 commit f1130db

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

copyparty/web/browser.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ var Ls = {
493493
"u_etaprep": '(preparing to upload)',
494494
"u_hashdone": 'hashing done',
495495
"u_hashing": 'hash',
496+
"u_dupdefer": "duplicate; will be processed after all other files",
496497
"u_fixed": "OK!  Fixed it 👍",
497498
"u_cuerr": "failed to upload chunk {0} of {1};\nprobably harmless, continuing\n\nfile: {2}",
498499
"u_cuerr2": "server rejected upload (chunk {0} of {1});\nwill retry later\n\nfile: {2}\n\nerror ",
@@ -1029,6 +1030,7 @@ var Ls = {
10291030
"u_etaprep": '(forbereder opplastning)',
10301031
"u_hashdone": 'befaring ferdig',
10311032
"u_hashing": 'les',
1033+
"u_dupdefer": "duplikat; vil bli håndtert til slutt",
10321034
"u_fixed": "OK!  Løste seg 👍",
10331035
"u_cuerr": "kunne ikke laste opp del {0} av {1};\nsikkert greit, fortsetter\n\nfil: {2}",
10341036
"u_cuerr2": "server nektet opplastningen (del {0} av {1});\nprøver igjen senere\n\nfil: {2}\n\nerror ",
@@ -1565,6 +1567,7 @@ var Ls = {
15651567
"u_etaprep": '(准备上传)',
15661568
"u_hashdone": '哈希完成',
15671569
"u_hashing": '哈希',
1570+
"u_dupdefer": "这是一个重复文件。它将在所有其他文件上传后进行处理", //m
15681571
"u_fixed": "好! 已修复 👍",
15691572
"u_cuerr": "上传块 {0} 的 {1} 失败;\n可能无害,继续中\n\n文件:{2}",
15701573
"u_cuerr2": "服务器拒绝上传(块 {0} 的 {1});\n稍后重试\n\n文件:{2}\n\n错误 ",

copyparty/web/up2k.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ function U2pvis(act, btns, uc, st) {
156156
'ERROR': '<span class="err">ERROR</span>',
157157
'OS-error': '<span class="err">OS-error</span>',
158158
'found': '<span class="inf">found</span>',
159+
'defer': '<span class="inf">defer</span>',
159160
'YOLO': '<span class="inf">YOLO</span>',
160161
'done': '<span class="ok">done</span>',
161162
};
@@ -2460,6 +2461,7 @@ function up2k_init(subtle) {
24602461
pvis.seth(t.n, 2, L.u_ehstmp, t);
24612462

24622463
var err = "",
2464+
cls = "ERROR",
24632465
rsp = unpre(xhr.responseText),
24642466
ofs = rsp.lastIndexOf('\nURL: ');
24652467

@@ -2489,6 +2491,8 @@ function up2k_init(subtle) {
24892491
if (!t.rechecks && (err_pend || err_srcb)) {
24902492
t.rechecks = 0;
24912493
t.want_recheck = true;
2494+
err = L.u_dupdefer;
2495+
cls = 'defer';
24922496
}
24932497
}
24942498
if (rsp.indexOf('server HDD is full') + 1)
@@ -2498,7 +2502,7 @@ function up2k_init(subtle) {
24982502
if (!t.t_uploading)
24992503
st.bytes.finished += t.size;
25002504

2501-
pvis.seth(t.n, 1, "ERROR");
2505+
pvis.seth(t.n, 1, cls);
25022506
pvis.seth(t.n, 2, err);
25032507
pvis.move(t.n, 'ng');
25042508

0 commit comments

Comments
 (0)