From 1195b8f17ee4781202643b1b551b326d61b99efa Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 29 Mar 2021 04:47:59 +0200 Subject: [PATCH] v0.10.3 --- copyparty/__version__.py | 4 ++-- copyparty/up2k.py | 1 + copyparty/web/browser.js | 10 +++++----- docs/notes.sh | 3 +++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/copyparty/__version__.py b/copyparty/__version__.py index f4bd8ede..58e52b44 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (0, 10, 2) +VERSION = (0, 10, 3) CODENAME = "zip it" -BUILD_DT = (2021, 3, 27) +BUILD_DT = (2021, 3, 29) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 2732fead..d5e9ac6e 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1310,6 +1310,7 @@ class Up2k(object): self.log("no cursor to write tags with??", c=1) continue + # TODO is undef if vol 404 on startup entags = self.entags[ptop] if not entags: self.log("no entags okay.jpg", c=3) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 1dc3bac9..26ff95cf 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -833,7 +833,7 @@ document.onkeydown = function (e) { v = r.tags[k] || ""; if (k == ".dur") { - var sv = s2ms(v); + var sv = v ? s2ms(v) : ""; nodes[nodes.length - 1] += '' + sv; continue; } @@ -1128,7 +1128,7 @@ var treectl = (function () { v = (r.tags || {})[k] || ""; if (k == ".dur") { - var sv = s2ms(v); + var sv = v ? s2ms(v) : ""; ln[ln.length - 1] += '' + sv; continue; } @@ -1411,8 +1411,8 @@ var filecols = (function () { if (!min) for (var a = 0, aa = rows.length; a < aa; a++) { var c = rows[a].cells[i]; - if (c) - var v = c.textContent = s2ms(c.textContent); + if (c && c.textContent) + c.textContent = s2ms(c.textContent); } } catch (ex) { } @@ -1634,7 +1634,7 @@ var msel = (function () { var names = []; var links = document.querySelectorAll('#files tbody tr.sel td:nth-child(2) a'); for (var a = 0, aa = links.length; a < aa; a++) - names.push(links[a].getAttribute('href').split('/').slice(-1)); + names.push(links[a].getAttribute('href').replace(/\/$/, "").split('/').slice(-1)); return names; } diff --git a/docs/notes.sh b/docs/notes.sh index e4ce5733..aa05c178 100644 --- a/docs/notes.sh +++ b/docs/notes.sh @@ -83,6 +83,9 @@ sqlite3 up2k.db 'select mt1.w, mt1.k, mt1.v, mt2.v from mt mt1 inner join mt mt2 time sqlite3 up2k.db 'select mt1.w from mt mt1 inner join mt mt2 on mt1.w = mt2.w where mt1.k = +mt2.k and mt1.rowid != mt2.rowid' > warks cat warks | while IFS= read -r x; do sqlite3 up2k.db "delete from mt where w = '$x'"; done +# dump all dbs +find -iname up2k.db | while IFS= read -r x; do sqlite3 "$x" 'select substr(w,1,12), rd, fn from up' | sed -r 's/\|/ \| /g' | while IFS= read -r y; do printf '%s | %s\n' "$x" "$y"; done; done + ## ## media