From b0e203d1f91b876075c9fd9ec259ba61afc09640 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 26 Sep 2021 19:35:13 +0200 Subject: [PATCH] fuse-cli: support fk volumes --- bin/copyparty-fuse.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/copyparty-fuse.py b/bin/copyparty-fuse.py index e3ffe1bd..cef8389d 100755 --- a/bin/copyparty-fuse.py +++ b/bin/copyparty-fuse.py @@ -71,7 +71,7 @@ except: elif MACOS: libfuse = "install https://osxfuse.github.io/" else: - libfuse = "apt install libfuse\n modprobe fuse" + libfuse = "apt install libfuse3-3\n modprobe fuse" print( "\n could not import fuse; these may help:" @@ -393,15 +393,16 @@ class Gateway(object): rsp = json.loads(rsp.decode("utf-8")) ret = [] - for is_dir, nodes in [[True, rsp["dirs"]], [False, rsp["files"]]]: + for statfun, nodes in [ + [self.stat_dir, rsp["dirs"]], + [self.stat_file, rsp["files"]], + ]: for n in nodes: - fname = unquote(n["href"]).rstrip(b"/") - fname = fname.decode("wtf-8") + fname = unquote(n["href"].split("?")[0]).rstrip(b"/").decode("wtf-8") if bad_good: fname = enwin(fname) - fun = self.stat_dir if is_dir else self.stat_file - ret.append([fname, fun(n["ts"], n["sz"]), 0]) + ret.append([fname, statfun(n["ts"], n["sz"]), 0]) return ret