mirror of
https://github.com/9001/copyparty.git
synced 2026-04-12 23:32:32 -06:00
parent
8e20506de8
commit
23d4a62e9f
|
|
@ -147,8 +147,11 @@ class AXS(object):
|
||||||
|
|
||||||
|
|
||||||
class Lim(object):
|
class Lim(object):
|
||||||
def __init__(self, log_func: Optional["RootLogger"]) -> None:
|
def __init__(
|
||||||
|
self, args: argparse.Namespace, log_func: Optional["RootLogger"]
|
||||||
|
) -> None:
|
||||||
self.log_func = log_func
|
self.log_func = log_func
|
||||||
|
self.use_scandir = not args.no_scandir
|
||||||
|
|
||||||
self.reg: Optional[dict[str, dict[str, Any]]] = None # up2k registry
|
self.reg: Optional[dict[str, dict[str, Any]]] = None # up2k registry
|
||||||
|
|
||||||
|
|
@ -312,12 +315,17 @@ class Lim(object):
|
||||||
return ret, d
|
return ret, d
|
||||||
|
|
||||||
def dive(self, path: str, lvs: int) -> Optional[str]:
|
def dive(self, path: str, lvs: int) -> Optional[str]:
|
||||||
items = bos.listdir(path)
|
|
||||||
|
|
||||||
if not lvs:
|
if not lvs:
|
||||||
# at leaf level
|
# at leaf level
|
||||||
|
items = statdir(self.log_func, self.use_scandir, False, path, True)
|
||||||
|
items = [
|
||||||
|
x
|
||||||
|
for x in items
|
||||||
|
if not stat.S_ISDIR(x[1].st_mode) and not x[0].endswith(".PARTIAL")
|
||||||
|
]
|
||||||
return None if len(items) >= self.rotn else ""
|
return None if len(items) >= self.rotn else ""
|
||||||
|
|
||||||
|
items = bos.listdir(path)
|
||||||
dirs = [int(x) for x in items if x and all(y in "1234567890" for y in x)]
|
dirs = [int(x) for x in items if x and all(y in "1234567890" for y in x)]
|
||||||
dirs.sort()
|
dirs.sort()
|
||||||
|
|
||||||
|
|
@ -2284,7 +2292,7 @@ class AuthSrv(object):
|
||||||
vol.flags["zipmax"] = True
|
vol.flags["zipmax"] = True
|
||||||
|
|
||||||
for vol in vfs.all_vols.values():
|
for vol in vfs.all_vols.values():
|
||||||
lim = Lim(self.log_func)
|
lim = Lim(self.args, self.log_func)
|
||||||
use = False
|
use = False
|
||||||
|
|
||||||
if vol.flags.get("nosub"):
|
if vol.flags.get("nosub"):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue