mirror of
https://github.com/9001/copyparty.git
synced 2026-01-14 00:32:40 -07:00
Update httpcli.py
Signed-off-by: ed <s@ocv.me>
This commit is contained in:
parent
532be05de5
commit
5d832b64b6
|
|
@ -117,7 +117,6 @@ from .util import (
|
||||||
undot,
|
undot,
|
||||||
unescape_cookie,
|
unescape_cookie,
|
||||||
unquotep,
|
unquotep,
|
||||||
unhumanize,
|
|
||||||
vjoin,
|
vjoin,
|
||||||
vol_san,
|
vol_san,
|
||||||
vroots,
|
vroots,
|
||||||
|
|
@ -1832,18 +1831,16 @@ class HttpCli(object):
|
||||||
or (zi == 4 and self.can_write and self.can_read)
|
or (zi == 4 and self.can_write and self.can_read)
|
||||||
or (zi == 3 and self.can_admin)
|
or (zi == 3 and self.can_admin)
|
||||||
):
|
):
|
||||||
vmaxb_value = unhumanize(vn.flags.get("vmaxb") or "0")
|
|
||||||
if vmaxb_value:
|
|
||||||
try:
|
|
||||||
bused, _ = self.conn.hsrv.broker.ask("up2k.get_volsizes", [vn.realpath]).get()[0]
|
|
||||||
bfree = max(0, vmaxb_value - bused)
|
|
||||||
btot = vmaxb_value
|
|
||||||
except:
|
|
||||||
bfree, btot, _ = get_df(vn.realpath, False)
|
bfree, btot, _ = get_df(vn.realpath, False)
|
||||||
else:
|
|
||||||
bfree, btot, _ = get_df(vn.realpath, False)
|
|
||||||
|
|
||||||
if btot:
|
if btot:
|
||||||
|
if "vmaxb" in vn.flags:
|
||||||
|
try:
|
||||||
|
zi, _ = self.conn.hsrv.broker.ask(
|
||||||
|
"up2k.get_volsizes", [vn.realpath]
|
||||||
|
).get()[0]
|
||||||
|
bfree = min(bfree, max(0, vn.lim.vbmax - zi))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
df = {
|
df = {
|
||||||
"quota-available-bytes": str(bfree),
|
"quota-available-bytes": str(bfree),
|
||||||
"quota-used-bytes": str(btot - bfree),
|
"quota-used-bytes": str(btot - bfree),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue