mirror of
https://github.com/9001/copyparty.git
synced 2026-06-18 20:22:27 -06:00
vjoins
This commit is contained in:
parent
22c3a3dd46
commit
5a8949d595
|
|
@ -123,6 +123,7 @@ from .util import (
|
||||||
unescape_cookie,
|
unescape_cookie,
|
||||||
unquotep,
|
unquotep,
|
||||||
vjoin,
|
vjoin,
|
||||||
|
vjoins,
|
||||||
vol_san,
|
vol_san,
|
||||||
vroots,
|
vroots,
|
||||||
vsplit,
|
vsplit,
|
||||||
|
|
@ -1919,7 +1920,7 @@ class HttpCli(object):
|
||||||
df = {}
|
df = {}
|
||||||
|
|
||||||
fgen = itertools.chain([topdir], fgen)
|
fgen = itertools.chain([topdir], fgen)
|
||||||
vtop = vjoin(self.args.R, vjoin(vn.vpath, rem))
|
vtop = vjoins(self.args.R, vn.vpath, rem)
|
||||||
|
|
||||||
chunksz = 0x7FF8 # preferred by nginx or cf (dunno which)
|
chunksz = 0x7FF8 # preferred by nginx or cf (dunno which)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ from .util import (
|
||||||
quotep,
|
quotep,
|
||||||
s3dec,
|
s3dec,
|
||||||
vjoin,
|
vjoin,
|
||||||
|
vjoins,
|
||||||
)
|
)
|
||||||
|
|
||||||
if HAVE_SQLITE3:
|
if HAVE_SQLITE3:
|
||||||
|
|
@ -437,7 +438,7 @@ class U2idx(object):
|
||||||
if rd.startswith("//") or fn.startswith("//"):
|
if rd.startswith("//") or fn.startswith("//"):
|
||||||
rd, fn = s3dec(rd, fn)
|
rd, fn = s3dec(rd, fn)
|
||||||
|
|
||||||
vp = vjoin(vjoin(vtop, rd), fn)
|
vp = vjoins(vtop, rd, fn)
|
||||||
|
|
||||||
if vp in seen_rps:
|
if vp in seen_rps:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ from .util import (
|
||||||
ub64enc,
|
ub64enc,
|
||||||
unhumanize,
|
unhumanize,
|
||||||
vjoin,
|
vjoin,
|
||||||
|
vjoins,
|
||||||
vsplit,
|
vsplit,
|
||||||
w8b64dec,
|
w8b64dec,
|
||||||
w8b64enc,
|
w8b64enc,
|
||||||
|
|
@ -3190,7 +3191,7 @@ class Up2k(object):
|
||||||
c2 = None
|
c2 = None
|
||||||
for cur, dp_dir, dp_fn in lost:
|
for cur, dp_dir, dp_fn in lost:
|
||||||
t = "forgetting desynced db entry: %r"
|
t = "forgetting desynced db entry: %r"
|
||||||
self.log(t % ("/" + vjoin(vjoin(vfs.vpath, dp_dir), dp_fn)))
|
self.log(t % ("/" + vjoins(vfs.vpath, dp_dir, dp_fn)))
|
||||||
self.db_rm(cur, vfs.flags, dp_dir, dp_fn, cj["size"])
|
self.db_rm(cur, vfs.flags, dp_dir, dp_fn, cj["size"])
|
||||||
if c2 and c2 != cur:
|
if c2 and c2 != cur:
|
||||||
c2.connection.commit()
|
c2.connection.commit()
|
||||||
|
|
|
||||||
|
|
@ -2679,6 +2679,10 @@ def vjoin(rd: str, fn: str) -> str:
|
||||||
return rd or fn
|
return rd or fn
|
||||||
|
|
||||||
|
|
||||||
|
def vjoins(*a: str) -> str:
|
||||||
|
return "/".join([x for x in a if x])
|
||||||
|
|
||||||
|
|
||||||
# url-join
|
# url-join
|
||||||
def ujoin(rd: str, fn: str) -> str:
|
def ujoin(rd: str, fn: str) -> str:
|
||||||
if rd and fn:
|
if rd and fn:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue