mirror of
				https://github.com/9001/copyparty.git
				synced 2025-11-04 05:43:17 +00:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					a900c36395 | ||
| 
						 | 
					1d9b324d3e | ||
| 
						 | 
					539e7b8efe | ||
| 
						 | 
					50a477ee47 | 
@@ -51,6 +51,8 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
 | 
			
		||||
            cname = name,  // will clobber
 | 
			
		||||
            sz = fobj.size,
 | 
			
		||||
            ids = [],
 | 
			
		||||
            fn_ids = [],
 | 
			
		||||
            md_ids = [],
 | 
			
		||||
            id_ok = false,
 | 
			
		||||
            m;
 | 
			
		||||
 | 
			
		||||
@@ -71,7 +73,7 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
 | 
			
		||||
 | 
			
		||||
            cname = cname.replace(m[1], '');
 | 
			
		||||
            yt_ids.add(m[1]);
 | 
			
		||||
            ids.push(m[1]);
 | 
			
		||||
            fn_ids.unshift(m[1]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // look for IDs in video metadata,
 | 
			
		||||
@@ -110,10 +112,13 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
 | 
			
		||||
 | 
			
		||||
                        console.log(`found ${m} @${bofs}, ${name} `);
 | 
			
		||||
                        yt_ids.add(m);
 | 
			
		||||
                        if (!has(ids, m)) {
 | 
			
		||||
                            ids.push(m);
 | 
			
		||||
                        if (!has(fn_ids, m) && !has(md_ids, m)) {
 | 
			
		||||
                            md_ids.push(m);
 | 
			
		||||
                            md_only.push(`${m} ${name}`);
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                            // id appears several times; make it preferred
 | 
			
		||||
                            md_ids.unshift(m);
 | 
			
		||||
 | 
			
		||||
                        // bail after next iteration
 | 
			
		||||
                        chunk = nchunks - 1;
 | 
			
		||||
@@ -130,6 +135,13 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (var yi of md_ids)
 | 
			
		||||
            ids.push(yi);
 | 
			
		||||
 | 
			
		||||
        for (var yi of fn_ids)
 | 
			
		||||
            if (!has(ids, yi))
 | 
			
		||||
                ids.push(yi);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (md_only.length)
 | 
			
		||||
@@ -164,6 +176,7 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
 | 
			
		||||
 | 
			
		||||
    function process_id_list(txt) {
 | 
			
		||||
        var wanted_ids = new Set(txt.trim().split('\n')),
 | 
			
		||||
            name_id = {},
 | 
			
		||||
            wanted_names = new Set(),  // basenames with a wanted ID
 | 
			
		||||
            wanted_files = new Set();  // filedrops
 | 
			
		||||
 | 
			
		||||
@@ -174,8 +187,11 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
 | 
			
		||||
                    wanted_files.add(good_files[a]);
 | 
			
		||||
 | 
			
		||||
                    var m = /(.*)\.(mp4|webm|mkv|flv|opus|ogg|mp3|m4a|aac)$/i.exec(name);
 | 
			
		||||
                    if (m)
 | 
			
		||||
                        wanted_names.add(m[1]);
 | 
			
		||||
                    if (!m)
 | 
			
		||||
                        continue;
 | 
			
		||||
 | 
			
		||||
                    wanted_names.add(m[1]);
 | 
			
		||||
                    name_id[m[1]] = file_ids[a][b];
 | 
			
		||||
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
@@ -189,6 +205,9 @@ async function a_up2k_namefilter(good_files, nil_files, bad_files, hooks) {
 | 
			
		||||
                name = name.replace(/\.[^\.]+$/, '');
 | 
			
		||||
                if (wanted_names.has(name)) {
 | 
			
		||||
                    wanted_files.add(good_files[a]);
 | 
			
		||||
 | 
			
		||||
                    var subdir = `${name_id[name]}-${Date.now()}-${a}`;
 | 
			
		||||
                    good_files[a][1] = subdir + '/' + good_files[a][1].split(/\//g).pop();
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
# coding: utf-8
 | 
			
		||||
 | 
			
		||||
VERSION = (1, 3, 14)
 | 
			
		||||
VERSION = (1, 3, 15)
 | 
			
		||||
CODENAME = "god dag"
 | 
			
		||||
BUILD_DT = (2022, 8, 15)
 | 
			
		||||
BUILD_DT = (2022, 8, 18)
 | 
			
		||||
 | 
			
		||||
S_VERSION = ".".join(map(str, VERSION))
 | 
			
		||||
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
 | 
			
		||||
 
 | 
			
		||||
@@ -318,6 +318,7 @@ var Ls = {
 | 
			
		||||
		"u_ehssrch": "server rejected the request to perform search",
 | 
			
		||||
		"u_ehsinit": "server rejected the request to initiate upload",
 | 
			
		||||
		"u_ehsdf": "server ran out of disk space!\n\nwill keep retrying, in case someone\nfrees up enough space to continue",
 | 
			
		||||
		"u_emtleak": "it looks like your webbrowser may have a memory leak;\nplease try the following:\n<ul><li>hit <code>F5</code> to refresh the page</li><li>then disable the  <code>mt</code>  button in the  <code>⚙️ settings</code></li><li>and try that upload again</li></ul>Uploads will be a bit slower, but oh well.\nSorry for the trouble!",
 | 
			
		||||
		"u_s404": "not found on server",
 | 
			
		||||
		"u_expl": "explain",
 | 
			
		||||
		"u_tu": '<p class="warn">WARNING: turbo enabled, <span> client may not detect and resume incomplete uploads; see turbo-button tooltip</span></p>',
 | 
			
		||||
@@ -656,6 +657,7 @@ var Ls = {
 | 
			
		||||
		"u_ehssrch": "server nektet forespørselen om å utføre søk",
 | 
			
		||||
		"u_ehsinit": "server nektet forespørselen om å begynne en ny opplastning",
 | 
			
		||||
		"u_ehsdf": "serveren er full!\n\nprøver igjen regelmessig,\ni tilfelle noen rydder litt...",
 | 
			
		||||
		"u_emtleak": "uff, det er mulig at nettleseren din har en minnelekkasje...\nForeslår at du prøver følgende:\n<ul><li>trykk F5 for å laste siden på nytt</li><li>så skru av  <code>mt</code>  bryteren under  <code>⚙️ innstillinger</code></li><li>og forsøk den samme opplastningen igjen</li></ul>Opplastning vil gå litt tregere, men det får så være.\nBeklager bryderiet!",
 | 
			
		||||
		"u_s404": "ikke funnet på serveren",
 | 
			
		||||
		"u_expl": "forklar",
 | 
			
		||||
		"u_tu": '<p class="warn">ADVARSEL: turbo er på, <span> avbrutte opplastninger vil muligens ikke oppdages og gjenopptas; hold musepekeren over turbo-knappen for mer info</span></p>',
 | 
			
		||||
 
 | 
			
		||||
@@ -847,6 +847,7 @@ function up2k_init(subtle) {
 | 
			
		||||
        },
 | 
			
		||||
        "car": 0,
 | 
			
		||||
        "slow_io": null,
 | 
			
		||||
        "oserr": false,
 | 
			
		||||
        "modn": 0,
 | 
			
		||||
        "modv": 0,
 | 
			
		||||
        "mod0": null
 | 
			
		||||
@@ -1365,6 +1366,14 @@ function up2k_init(subtle) {
 | 
			
		||||
            etaskip = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function got_oserr() {
 | 
			
		||||
        if (!hws.length || !uc.hashw || st.oserr)
 | 
			
		||||
            return;
 | 
			
		||||
 | 
			
		||||
        st.oserr = true;
 | 
			
		||||
        modal.alert(L.u_emtleak);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /////
 | 
			
		||||
    ////
 | 
			
		||||
    ///   actuator
 | 
			
		||||
@@ -1723,6 +1732,7 @@ function up2k_init(subtle) {
 | 
			
		||||
                    pvis.seth(t.n, 2, err + ' @ ' + car);
 | 
			
		||||
                    console.log('OS-error', reader.error, '@', car);
 | 
			
		||||
                    handled = true;
 | 
			
		||||
                    got_oserr();
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (handled) {
 | 
			
		||||
@@ -1841,6 +1851,8 @@ function up2k_init(subtle) {
 | 
			
		||||
                pvis.seth(t.n, 1, d[1]);
 | 
			
		||||
                pvis.seth(t.n, 2, d[2]);
 | 
			
		||||
                console.log(d[1], d[2]);
 | 
			
		||||
                if (d[1] == 'OS-error')
 | 
			
		||||
                    got_oserr();
 | 
			
		||||
 | 
			
		||||
                pvis.move(t.n, 'ng');
 | 
			
		||||
                apop(st.busy.hash, t);
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ function hex2u8(txt) {
 | 
			
		||||
 | 
			
		||||
var subtle = null;
 | 
			
		||||
try {
 | 
			
		||||
    subtle = crypto.subtle || crypto.webkitSubtle;
 | 
			
		||||
    subtle = crypto.subtle;
 | 
			
		||||
    subtle.digest('SHA-512', new Uint8Array(1)).then(
 | 
			
		||||
        function (x) { },
 | 
			
		||||
        function (x) { load_fb(); }
 | 
			
		||||
@@ -23,11 +23,20 @@ function load_fb() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
var reader = null,
 | 
			
		||||
    busy = false;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
onmessage = (d) => {
 | 
			
		||||
    var [nchunk, fobj, car, cdr] = d.data,
 | 
			
		||||
        t0 = Date.now(),
 | 
			
		||||
    if (busy)
 | 
			
		||||
        return postMessage(["panic", 'worker got another task while busy']);
 | 
			
		||||
 | 
			
		||||
    if (!reader)
 | 
			
		||||
        reader = new FileReader();
 | 
			
		||||
 | 
			
		||||
    var [nchunk, fobj, car, cdr] = d.data,
 | 
			
		||||
        t0 = Date.now();
 | 
			
		||||
 | 
			
		||||
    reader.onload = function (e) {
 | 
			
		||||
        try {
 | 
			
		||||
            //console.log('[ w] %d HASH bgin', nchunk);
 | 
			
		||||
@@ -39,6 +48,7 @@ onmessage = (d) => {
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
    reader.onerror = function () {
 | 
			
		||||
        busy = false;
 | 
			
		||||
        var err = reader.error + '';
 | 
			
		||||
 | 
			
		||||
        if (err.indexOf('NotReadableError') !== -1 || // win10-chrome defender
 | 
			
		||||
@@ -49,12 +59,14 @@ onmessage = (d) => {
 | 
			
		||||
        postMessage(["ferr", err]);
 | 
			
		||||
    };
 | 
			
		||||
    //console.log('[ w] %d read bgin', nchunk);
 | 
			
		||||
    busy = true;
 | 
			
		||||
    reader.readAsArrayBuffer(
 | 
			
		||||
        File.prototype.slice.call(fobj, car, cdr));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    var hash_calc = function (buf) {
 | 
			
		||||
        var hash_done = function (hashbuf) {
 | 
			
		||||
            busy = false;
 | 
			
		||||
            try {
 | 
			
		||||
                var hslice = new Uint8Array(hashbuf).subarray(0, 33);
 | 
			
		||||
                //console.log('[ w] %d HASH DONE', nchunk);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,20 @@
 | 
			
		||||
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  
 | 
			
		||||
# 2022-0815-1825  `v1.3.14`  fix windows db
 | 
			
		||||
 | 
			
		||||
after two exciting releases, time for something boring
 | 
			
		||||
* read-only demo server at https://a.ocv.me/pub/demo/
 | 
			
		||||
* latest gzip edition of the sfx: [v1.0.14](https://github.com/9001/copyparty/releases/tag/v1.0.14#:~:text=release-specific%20notes)
 | 
			
		||||
 | 
			
		||||
## new features
 | 
			
		||||
* upload-info (ip and timestamp) is provided to `mtp` tagparser plugins as json
 | 
			
		||||
* tagscanner will index `fmt` (file-format / container type) by default
 | 
			
		||||
  * and `description` can be enabled in `-mte`
 | 
			
		||||
 | 
			
		||||
## bugfixes
 | 
			
		||||
* [v1.3.12](https://github.com/9001/copyparty/releases/tag/v1.3.12) broke file-indexing on windows if an entire HDD was mounted as a volume
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  
 | 
			
		||||
# 2022-0812-2258  `v1.3.12`  quickboot
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user