diff --git a/copyparty/u2idx.py b/copyparty/u2idx.py index a45f4ca6..152032d2 100644 --- a/copyparty/u2idx.py +++ b/copyparty/u2idx.py @@ -5,7 +5,7 @@ import re import os from datetime import datetime -from .util import u8safe, html_escape, Pebkac +from .util import u8safe, s3dec, html_escape, Pebkac from .up2k import up2k_wark_from_hashlist @@ -142,10 +142,10 @@ class U2idx(object): w = hit["w"] del hit["w"] tags = {} - q = "select k, v from mt where w = ? and k != 'x'" - for k, v in cur.execute(q, (w,)): + q2 = "select k, v from mt where w = ? and k != 'x'" + for k, v2 in cur.execute(q2, (w,)): taglist[k] = True - tags[k] = v + tags[k] = v2 hit["tags"] = tags diff --git a/docs/notes.sh b/docs/notes.sh index d4898113..9d32450a 100644 --- a/docs/notes.sh +++ b/docs/notes.sh @@ -74,7 +74,7 @@ shab64() { sp=$1; f="$2"; v=0; sz=$(stat -c%s "$f"); while true; do w=$((v+sp*10 sqlite3 up2k.db 'select mt1.w, mt1.k, mt1.v, mt2.v from mt mt1 inner join mt mt2 on mt1.w = mt2.w where mt1.k = mt2.k and mt1.rowid != mt2.rowid' # partial reindex by deleting all tags for a list of files -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 +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