mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
oh
This commit is contained in:
parent
dac2fad48e
commit
faac894706
|
@ -145,14 +145,12 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
|
||||||
xhr.setRequestHeader('Content-Type', 'text/plain');
|
xhr.setRequestHeader('Content-Type', 'text/plain');
|
||||||
xhr.onload = xhr.onerror = function () {
|
xhr.onload = xhr.onerror = function () {
|
||||||
if (this.status != 200)
|
if (this.status != 200)
|
||||||
return toast.err(0, `sorry, database query failed; _; \n\nplease let us know so we can look at it, thx!!\n\nerror ${this.status}: ${(this.response && this.response.err) || this.responseText} `);
|
return toast.err(0, `sorry, database query failed ;_;\n\nplease let us know so we can look at it, thx!!\n\nerror ${this.status}: ${(this.response && this.response.err) || this.responseText}`);
|
||||||
|
|
||||||
process_id_list(this.responseText);
|
process_id_list(this.responseText);
|
||||||
};
|
};
|
||||||
xhr.send(Array.from(yt_ids).join('\n'));
|
xhr.send(Array.from(yt_ids).join('\n'));
|
||||||
|
|
||||||
setTimeout(function () { process_id_list('Nf-nN1wF5Xo\n'); }, 500);
|
|
||||||
|
|
||||||
function process_id_list(txt) {
|
function process_id_list(txt) {
|
||||||
var wanted_ids = new Set(txt.trim().split('\n')),
|
var wanted_ids = new Set(txt.trim().split('\n')),
|
||||||
wanted_names = new Set(), // basenames with a wanted ID
|
wanted_names = new Set(), // basenames with a wanted ID
|
||||||
|
@ -197,7 +195,7 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var n_skip = good_files.length - wanted_files.size,
|
var n_skip = good_files.length - wanted_files.size,
|
||||||
msg = `you added ${good_files.length} files; ${n_skip} of them were skipped --\neither because we already have them,\nor because there is no youtube-ID in your filename.\n\n<code>OK</code> / <code>Enter</code> = continue uploading just the ${wanted_files.size} files we definitely need\n\n<code>Cancel</code> / <code>ESC</code> = override the filter; upload ALL the files you added`;
|
msg = `you added ${good_files.length} files; ${good_files.length == n_skip ? 'all' : n_skip} of them were skipped --\neither because we already have them,\nor because there is no youtube-ID in your filenames.\n\n<code>OK</code> / <code>Enter</code> = continue uploading just the ${wanted_files.size} files we definitely need\n\n<code>Cancel</code> / <code>ESC</code> = override the filter; upload ALL the files you added`;
|
||||||
|
|
||||||
if (!n_skip)
|
if (!n_skip)
|
||||||
upload_filtered();
|
upload_filtered();
|
||||||
|
|
Loading…
Reference in a new issue