From be65c3c6cf5b103722a5481cbcbaa216ed61884c Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 7 Aug 2021 21:11:01 +0200 Subject: [PATCH] cleanup --- README.md | 19 ++++++++++--------- copyparty/web/browser.js | 2 +- copyparty/web/up2k.js | 12 +----------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 331ca679..93784495 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,10 @@ turn your phone or raspi into a portable file server with resumable uploads/down * [batch rename](#batch-rename) * [markdown viewer](#markdown-viewer) * [other tricks](#other-tricks) -* [searching](#searching) - * [search configuration](#search-configuration) - * [database location](#database-location) + * [searching](#searching) +* [server config](#server-config) + * [upload rules](#upload-rules) + * [database location](#database-location)upload rules * [metadata from audio files](#metadata-from-audio-files) * [file parser plugins](#file-parser-plugins) * [complete examples](#complete-examples) @@ -431,7 +432,7 @@ the metadata keys you can use in the format field are the ones in the file-brows * if you are using media hotkeys to switch songs and are getting tired of seeing the OSD popup which Windows doesn't let you disable, consider https://ocv.me/dev/?media-osd-bgone.ps1 -# searching +## searching ![copyparty-search-fs8](https://user-images.githubusercontent.com/241032/115978060-6772bd80-a57d-11eb-81d3-174e869b72c3.png) @@ -443,12 +444,12 @@ path/name queries are space-separated, AND'ed together, and words are negated wi * path: `shibayan -bossa` finds all files where one of the folders contain `shibayan` but filters out any results where `bossa` exists somewhere in the path * name: `demetori styx` gives you [good stuff](https://www.youtube.com/watch?v=zGh0g14ZJ8I&list=PL3A147BD151EE5218&index=9) -add `-e2ts` to also scan/index tags from music files: +add the argument `-e2ts` to also scan/index tags from music files, which brings us over to: -## search configuration +# server config -searching relies on two databases, the up2k filetree (`-e2d`) and the metadata tags (`-e2t`). Configuration can be done through arguments, volume flags, or a mix of both. +file indexing relies on two databases, the up2k filetree (`-e2d`) and the metadata tags (`-e2t`). Configuration can be done through arguments, volume flags, or a mix of both. through arguments: * `-e2d` enables file indexing on upload @@ -475,7 +476,7 @@ you can choose to only index filename/path/size/last-modified (and not the hash if you set `--no-hash`, you can enable hashing for specific volumes using flag `:c,ehash` -## upload rules (Coming Soon™) +## upload rules you can set upload rules using volume flags, some examples: @@ -484,7 +485,7 @@ you can set upload rules using volume flags, some examples: * `:c,rotn=1000,2` moves uploads into subfolders, up to 1000 files in each folder before making a new one, two levels deep (must be at least 1) * `:c,rotf=%Y/%m/%d/%H` enforces files to be uploaded into a structure of subfolders according to that date format * if someone uploads to `/foo/bar` the path would be rewritten to `/foo/bar/2021/08/06/23` for example - * but the actual date is not verified, just the structure, so the uploader can choose any values which conform to the format string + * but the actual value is not verified, just the structure, so the uploader can choose any values which conform to the format string * just to avoid additional complexity in up2k which is enough of a mess already you can also set transaction limits which apply per-IP and per-volume, but these assume `-j 1` (default) otherwise the limits will be off, for example `-j 4` would allow anywhere between 1x and 4x the limits you set depending on which processing node the client gets routed to diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index df61a506..fdcdda40 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1283,7 +1283,7 @@ function play(tid, is_ev, seek, call_depth) { } else { if (call_depth !== undefined) - return toast.err(0, 'failed to load ogv.js:\ncannot play ogg/opus in this browser'); + return toast.err(0, 'failed to load ogv.js:\ncannot play ogg/opus in this browser\n(try a non-apple device)'); toast.inf(0, '

loading ogv.js

thanks apple

'); diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 3410ca9b..b3c66092 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -97,13 +97,11 @@ function up2k_flagbus() { } }; var do_take = function (now) { - //dbg('*', 'do_take'); tx(now, "have"); flag.owner = [flag.id, now]; flag.ours = true; }; var do_want = function (now) { - //dbg('*', 'do_want'); tx(now, "want"); }; flag.take = function (now) { @@ -260,7 +258,7 @@ function U2pvis(act, btns) { var obj = ebi('f{0}p'.format(fobj.n)), o1 = p[0] - 2, o2 = p[0] - 0.1, o3 = p[0]; - if (!obj) { //} || true) { + if (!obj) { var msg = [ "act", r.act, "in", fo.in, @@ -482,7 +480,6 @@ function fsearch_explain(n) { function up2k_init(subtle) { - // show modal message function showmodal(msg) { ebi('u2notbtn').innerHTML = msg; ebi('u2btn').style.display = 'none'; @@ -490,7 +487,6 @@ function up2k_init(subtle) { ebi('u2conf').style.opacity = '0.5'; } - // hide modal message function unmodal() { ebi('u2notbtn').style.display = 'none'; ebi('u2btn').style.display = 'block'; @@ -507,7 +503,6 @@ function up2k_init(subtle) { // chrome<37 firefox<34 edge<12 opera<24 safari<7 shame = 'your browser is impressively ancient'; - // upload ui hidden by default, clicking the header shows it var got_deps = false; function init_deps() { if (!got_deps && !subtle && !window.asmCrypto) { @@ -524,11 +519,9 @@ function up2k_init(subtle) { got_deps = true; } - // show uploader if the user only has write-access if (perms.length && !has(perms, 'read')) goto('up2k'); - // shows or clears a message in the basic uploader ui function setmsg(msg, type) { if (msg !== undefined) { ebi('u2err').setAttribute('class', type); @@ -546,13 +539,11 @@ function up2k_init(subtle) { } } - // switches to the basic uploader with msg as error message function un2k(msg) { setmsg(msg, 'err'); return false; } - // handle user intent to use the basic uploader instead ebi('u2nope').onclick = function (e) { ev(e); setmsg(suggest_up2k, 'msg'); @@ -769,7 +760,6 @@ function up2k_init(subtle) { } ngot += 1; }); - // console.log("ngot: " + ngot); if (!ngot) { dirs.shift(); rd = null;