This commit is contained in:
ed 2021-03-20 03:08:16 +00:00
parent a3e2b2ec87
commit b61022b374
2 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@ import re
import os import os
from datetime import datetime 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 from .up2k import up2k_wark_from_hashlist
@ -142,10 +142,10 @@ class U2idx(object):
w = hit["w"] w = hit["w"]
del hit["w"] del hit["w"]
tags = {} tags = {}
q = "select k, v from mt where w = ? and k != 'x'" q2 = "select k, v from mt where w = ? and k != 'x'"
for k, v in cur.execute(q, (w,)): for k, v2 in cur.execute(q2, (w,)):
taglist[k] = True taglist[k] = True
tags[k] = v tags[k] = v2
hit["tags"] = tags hit["tags"] = tags

View file

@ -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' 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 # 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 cat warks | while IFS= read -r x; do sqlite3 up2k.db "delete from mt where w = '$x'"; done