mirror of
https://github.com/9001/copyparty.git
synced 2026-09-24 21:00:27 +01:00
vjoins
This commit is contained in:
@@ -123,6 +123,7 @@ from .util import (
|
||||
unescape_cookie,
|
||||
unquotep,
|
||||
vjoin,
|
||||
vjoins,
|
||||
vol_san,
|
||||
vroots,
|
||||
vsplit,
|
||||
@@ -1919,7 +1920,7 @@ class HttpCli(object):
|
||||
df = {}
|
||||
|
||||
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)
|
||||
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@ from .util import (
|
||||
quotep,
|
||||
s3dec,
|
||||
vjoin,
|
||||
vjoins,
|
||||
)
|
||||
|
||||
if HAVE_SQLITE3:
|
||||
@@ -437,7 +438,7 @@ class U2idx(object):
|
||||
if rd.startswith("//") or fn.startswith("//"):
|
||||
rd, fn = s3dec(rd, fn)
|
||||
|
||||
vp = vjoin(vjoin(vtop, rd), fn)
|
||||
vp = vjoins(vtop, rd, fn)
|
||||
|
||||
if vp in seen_rps:
|
||||
continue
|
||||
|
||||
+2
-1
@@ -70,6 +70,7 @@ from .util import (
|
||||
ub64enc,
|
||||
unhumanize,
|
||||
vjoin,
|
||||
vjoins,
|
||||
vsplit,
|
||||
w8b64dec,
|
||||
w8b64enc,
|
||||
@@ -3190,7 +3191,7 @@ class Up2k(object):
|
||||
c2 = None
|
||||
for cur, dp_dir, dp_fn in lost:
|
||||
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"])
|
||||
if c2 and c2 != cur:
|
||||
c2.connection.commit()
|
||||
|
||||
@@ -2679,6 +2679,10 @@ def vjoin(rd: str, fn: str) -> str:
|
||||
return rd or fn
|
||||
|
||||
|
||||
def vjoins(*a: str) -> str:
|
||||
return "/".join([x for x in a if x])
|
||||
|
||||
|
||||
# url-join
|
||||
def ujoin(rd: str, fn: str) -> str:
|
||||
if rd and fn:
|
||||
|
||||
Reference in New Issue
Block a user