From 0408b3564a18eaaaba461cde2ba3426727997ba6 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 29 Jul 2025 20:07:11 +0000 Subject: [PATCH] webdav: send diskfree; closes #272 --- copyparty/httpcli.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 9052acc0..8bb12870 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1575,6 +1575,18 @@ class HttpCli(object): self.log("inaccessible: %r" % ("/" + self.vpath,)) raise Pebkac(401, "authenticate") + if "quota-available-bytes" in props and not self.args.nid: + bfree, btot, _ = get_df(vn.realpath, False) + if btot: + df = { + "quota-available-bytes": str(bfree), + "quota-used-bytes": str(btot - bfree), + } + else: + df = {} + else: + df = {} + fgen = itertools.chain([topdir], fgen) vtop = vjoin(self.args.R, vjoin(vn.vpath, rem)) @@ -1617,6 +1629,9 @@ class HttpCli(object): ap = os.path.join(tap, x["vp"]) pvs["getcontenttype"] = html_escape(guess_mime(rp, ap)) pvs["getcontentlength"] = str(st.st_size) + elif df: + pvs.update(df) + df = {} for k, v in pvs.items(): if k not in props: