diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index b81145d7..988d5593 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -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) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index a80168fb..caeae0eb 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -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) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index b70acc49..fbfd46b3 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -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; }