fix dumb mistakes

This commit is contained in:
ed 2021-11-15 20:13:16 +01:00
parent 2da3bdcd47
commit 12b3a62586
3 changed files with 29 additions and 18 deletions

View file

@ -436,12 +436,12 @@ class HttpCli(object):
if "ups" in self.uparam:
return self.tx_ups()
if "h" in self.uparam:
return self.tx_mounts()
if "k304" in self.uparam:
return self.set_k304()
if "h" in self.uparam:
return self.tx_mounts()
# conditional redirect to single volumes
if self.vpath == "" and not self.ouparam:
nread = len(self.rvol)

View file

@ -1447,10 +1447,13 @@ class Up2k(object):
if not nchunk:
raise Pebkac(400, "unknown chunk")
if wark in job["busy"]:
raise Pebkac(400, "that chunk is already being written to")
if chash in job["busy"]:
nh = len(job["hash"])
idx = job["hash"].index(chash)
m = "that chunk is already being written to:\n {}\n {} {}/{}\n {}"
raise Pebkac(400, m.format(wark, chash, idx, nh, job["name"]))
job["busy"][wark] = 1
job["busy"][chash] = 1
job["poke"] = time.time()
@ -1465,7 +1468,7 @@ class Up2k(object):
with self.mutex:
job = self.registry[ptop].get(wark)
if job:
job["busy"].pop(wark, None)
job["busy"].pop(chash, None)
return [True]
@ -1479,7 +1482,7 @@ class Up2k(object):
except Exception as ex:
return "confirm_chunk, wark, " + repr(ex)
job["busy"].pop(wark, None)
job["busy"].pop(chash, None)
try:
job["need"].remove(chash)

View file

@ -1225,6 +1225,22 @@ var audio_eq = (function () {
QS('input.eq_gain[band="amp"]').value = r.amp;
};
r.stop = function () {
if (r.filters.length)
for (var a = 0; a < r.filters.length; a++)
r.filters[a].disconnect();
r.filters = [];
if (!mp)
return;
if (mp.acs)
mp.acs.disconnect();
mp.acs = null;
};
r.apply = function () {
r.draw();
@ -1234,16 +1250,7 @@ var audio_eq = (function () {
if (!actx || !mp.au || (!r.en && !mp.acs))
return;
if (mp.acs) {
for (var a = 0; a < r.filters.length; a++)
r.filters[a].disconnect();
r.filters = [];
mp.acs.disconnect();
mp.acs = null;
}
r.stop();
mp.au.id = mp.au.id || Date.now();
mp.acs = r.acst[mp.au.id] = r.acst[mp.au.id] || actx.createMediaElementSource(mp.au);
@ -4946,6 +4953,7 @@ ebi('files').onclick = ebi('docul').onclick = function (e) {
function reload_mp() {
if (mp && mp.au) {
audio_eq.stop();
mp.au.pause();
mp.au = null;
}