diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 5fad9880..d8cfafa1 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1311,20 +1311,23 @@ class HttpCli(object): def tx_mounts(self): suf = self.urlq(rm=["h"]) - rvol = [x + "/" if x else x for x in self.rvol] - wvol = [x + "/" if x else x for x in self.wvol] + rvol, wvol, avol = [ + [("/" + x).rstrip("/") + "/" for x in y] + for y in [self.rvol, self.wvol, self.avol] + ] vstate = {} if self.avol and not self.args.no_rescan: x = self.conn.hsrv.broker.put(True, "up2k.get_volstate") vstate = json.loads(x.get()) + vstate = {("/" + k).rstrip("/") + "/": v for k, v in vstate.items()} html = self.j2( "splash", this=self, rvol=rvol, wvol=wvol, - avol=self.avol, + avol=avol, vstate=vstate, url_suf=suf, ) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index da0a9f8f..9aed45b8 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -181,17 +181,20 @@ class Up2k(object): for vol in vols: try: os.listdir(vol.realpath) - if not self.register_vpath(vol.realpath, vol.flags): - raise Exception() - - if vol.vpath in scan_vols or not scan_vols: - live_vols.append(vol) - - if vol.vpath not in self.volstate: - self.volstate[vol.vpath] = "OFFLINE (not initialized)" except: + self.volstate[vol.vpath] = "OFFLINE (cannot access folder)" + self.log("cannot access " + vol.realpath, c=1) + continue + + if not self.register_vpath(vol.realpath, vol.flags): # self.log("db not enabled for {}".format(m, vol.realpath)) - pass + continue + + if vol.vpath in scan_vols or not scan_vols: + live_vols.append(vol) + + if vol.vpath not in self.volstate: + self.volstate[vol.vpath] = "OFFLINE (pending initialization)" vols = live_vols need_vac = {} @@ -585,7 +588,8 @@ class Up2k(object): del self.pp for k in list(self.volstate.keys()): - self.volstate[k] = "online, idle" + if "OFFLINE" not in self.volstate[k]: + self.volstate[k] = "online, idle" def _run_one_mtp(self, ptop): entags = self.entags[ptop] @@ -1247,7 +1251,7 @@ class Up2k(object): while fsz > 0: if self.pp: self.pp.msg = "{} MB, {}".format(int(fsz / 1024 / 1024), path) - + hashobj = hashlib.sha512() rem = min(csz, fsz) fsz -= rem diff --git a/copyparty/web/splash.html b/copyparty/web/splash.html index acbffe62..e3bd332a 100644 --- a/copyparty/web/splash.html +++ b/copyparty/web/splash.html @@ -20,13 +20,13 @@ {% for mp in avol %} {%- if mp in vstate and vstate[mp] %} - /{{ mp }}rescan{{ vstate[mp] }} + {{ mp }}rescan{{ vstate[mp] }} {%- endif %} {% endfor %}
- dump stack + dump stack
{%- endif %} @@ -34,7 +34,7 @@

you can browse these:

{%- endif %} @@ -43,7 +43,7 @@

you can upload to:

{%- endif %}