This commit is contained in:
ed 2021-03-06 02:30:36 +01:00
parent 24fdada0a0
commit 2381692aba
3 changed files with 14 additions and 10 deletions

View file

@ -37,7 +37,11 @@ class U2idx(object):
fsize = body["size"] fsize = body["size"]
fhash = body["hash"] fhash = body["hash"]
wark = up2k_wark_from_hashlist(self.args.salt, fsize, fhash) wark = up2k_wark_from_hashlist(self.args.salt, fsize, fhash)
return self.run_query(vols, "w = ?", [wark], "", [])[0]
uq = "substr(w,1,16) = ? and w = ?"
uv = [wark[:16], wark]
return self.run_query(vols, uq, uv, "", [])[0]
def get_cur(self, ptop): def get_cur(self, ptop):
cur = self.cur.get(ptop) cur = self.cur.get(ptop)

View file

@ -590,7 +590,7 @@ function autoplay_blocked() {
if (document.querySelector('#srch_form.tags')) if (document.querySelector('#srch_form.tags'))
sconf.push(["tags", sconf.push(["tags",
["tags", "tags", "tags contains", "46"] ["tags", "tags", "tags contains   (^=start, end=$)", "46"]
]); ]);
var html = []; var html = [];
@ -654,7 +654,7 @@ function autoplay_blocked() {
return; return;
if (this.status !== 200) { if (this.status !== 200) {
alert('ah fug\n' + this.status + ": " + this.responseText); alert("http " + this.status + ": " + this.responseText);
return; return;
} }
@ -729,7 +729,7 @@ function autoplay_blocked() {
var treedata = null; var treedata = null;
var dyn = bcfg_get('dyntree', true); var dyn = bcfg_get('dyntree', true);
var treesz = icfg_get('treesz', 16); var treesz = icfg_get('treesz', 16);
treesz = isNaN(treesz) ? 16 : Math.min(Math.max(treesz, 4), 50); treesz = Math.min(Math.max(treesz, 4), 50);
console.log('treesz [' + treesz + ']'); console.log('treesz [' + treesz + ']');
function entree(e) { function entree(e) {
@ -764,7 +764,7 @@ function autoplay_blocked() {
return; return;
if (this.status !== 200) { if (this.status !== 200) {
alert('ah fug\n' + this.status + ": " + this.responseText); alert("http " + this.status + ": " + this.responseText);
return; return;
} }
@ -870,7 +870,7 @@ function autoplay_blocked() {
return; return;
if (this.status !== 200) { if (this.status !== 200) {
alert('ah fug\n' + this.status + ": " + this.responseText); alert("http " + this.status + ": " + this.responseText);
return; return;
} }

View file

@ -156,7 +156,7 @@ function opclick(e) {
var dest = this.getAttribute('data-dest'); var dest = this.getAttribute('data-dest');
goto(dest); goto(dest);
swrite('opmode', dest || undefined); swrite('opmode', dest || null);
var input = document.querySelector('.opview.act input:not([type="hidden"])') var input = document.querySelector('.opview.act input:not([type="hidden"])')
if (input) if (input)
@ -262,12 +262,12 @@ function sread(key) {
if (window.localStorage) if (window.localStorage)
return localStorage.getItem(key); return localStorage.getItem(key);
return ''; return null;
} }
function swrite(key, val) { function swrite(key, val) {
if (window.localStorage) { if (window.localStorage) {
if (val === undefined) if (val === undefined || val === null)
localStorage.removeItem(key); localStorage.removeItem(key);
else else
localStorage.setItem(key, val); localStorage.setItem(key, val);
@ -293,7 +293,7 @@ function icfg_get(name, defval) {
var o = ebi(name); var o = ebi(name);
var val = parseInt(sread(name)); var val = parseInt(sread(name));
if (val === null) if (isNaN(val))
return parseInt(o ? o.value : defval); return parseInt(o ? o.value : defval);
if (o) if (o)