diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 41afd496..b3079c05 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2634,8 +2634,7 @@ class HttpCli(object): break fe["tags"] = {k: v for k, v in r} - - _ = [tagset.add(k) for fe in files for k in fe["tags"]] + _ = [tagset.add(k) for k in fe["tags"]] if icur: taglist = [k for k in vn.flags.get("mte", "").split(",") if k in tagset] diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 915c84f6..35aec9c5 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -3734,7 +3734,7 @@ var thegrid = (function () { in_tree.click(); else if (is_dir && !have_sel) - treectl.reqls(href, true, true); + treectl.reqls(href, true); else if (!is_img && have_sel) window.open(href, '_blank'); @@ -4766,7 +4766,7 @@ var treectl = (function () { r.goto = function (url, push, back) { get_tree("", url, true); - r.reqls(url, push, true, back); + r.reqls(url, push, back); }; function get_tree(top, dst, rst) { @@ -4785,28 +4785,31 @@ var treectl = (function () { if (!xhrchk(this, L.tl_xe1, L.tl_xe2)) return; - var cur = ebi('treeul').getAttribute('ts'); - if (cur && parseInt(cur) > this.ts) { - console.log("reject tree"); - return; - } - ebi('treeul').setAttribute('ts', this.ts); - - var top = this.top == '.' ? this.dst : this.top, - name = uricom_dec(top.split('/').slice(-2)[0]), - rtop = top.replace(/^\/+/, ""), - res; - try { - res = JSON.parse(this.responseText); + var res = JSON.parse(this.responseText); } catch (ex) { return; } - var html = parsetree(res, rtop); - if (!this.top) { + rendertree(res, this.ts, this.top, this.dst, this.rst); + } + + function rendertree(res, ts, top0, dst, rst) { + var cur = ebi('treeul').getAttribute('ts'); + if (cur && parseInt(cur) > ts) { + console.log("reject tree"); + return; + } + ebi('treeul').setAttribute('ts', ts); + + var top = top0 == '.' ? dst : top0, + name = uricom_dec(top.split('/').slice(-2)[0]), + rtop = top.replace(/^\/+/, ""), + html = parsetree(res, rtop); + + if (!top0) { html = '