mirror of
https://github.com/9001/copyparty.git
synced 2026-06-21 21:52:25 -06:00
Update httpcli.py
Signed-off-by: ed <s@ocv.me>
This commit is contained in:
parent
6b60ac83a1
commit
aa818071d5
|
|
@ -7187,18 +7187,18 @@ class HttpCli(object):
|
||||||
files = []
|
files = []
|
||||||
ptn_hr = RE_HR
|
ptn_hr = RE_HR
|
||||||
use_abs_url = is_opds or (
|
use_abs_url = is_opds or (
|
||||||
vpath
|
vpath and not is_ls and not is_js and not self.trailing_slash
|
||||||
and not is_ls
|
|
||||||
and not is_js
|
|
||||||
and not self.trailing_slash
|
|
||||||
)
|
)
|
||||||
for fn in ls_names:
|
for fn in ls_names:
|
||||||
base = ""
|
base = ""
|
||||||
href = fn
|
href = fn
|
||||||
if use_abs_url:
|
if use_abs_url:
|
||||||
|
if is_opds:
|
||||||
base = self.args.SRS
|
base = self.args.SRS
|
||||||
if vpath:
|
if vpath:
|
||||||
base += vpath + "/"
|
base += vpath + "/"
|
||||||
|
else:
|
||||||
|
base = "/" + vpath + "/"
|
||||||
href = base + fn
|
href = base + fn
|
||||||
|
|
||||||
if fn in vfs_virt:
|
if fn in vfs_virt:
|
||||||
|
|
@ -7529,19 +7529,25 @@ class HttpCli(object):
|
||||||
|
|
||||||
j2a["opds_osd"] = "%s%s?opds&osd" % (self.args.SRS, quotep(vpath))
|
j2a["opds_osd"] = "%s%s?opds&osd" % (self.args.SRS, quotep(vpath))
|
||||||
j2a["opds_id"] = uuid.uuid5(uuid.NAMESPACE_URL, vpath + "/").urn
|
j2a["opds_id"] = uuid.uuid5(uuid.NAMESPACE_URL, vpath + "/").urn
|
||||||
j2a["opds_title"] = (vpath.rsplit("/", 1)[-1] + '/') if vpath else self.args.bname
|
j2a["opds_title"] = (
|
||||||
|
(vpath.rsplit("/", 1)[-1] + "/") if vpath else self.args.bname
|
||||||
|
)
|
||||||
for item in dirs:
|
for item in dirs:
|
||||||
href = item["href"]
|
href = item["href"]
|
||||||
href += ("&" if "?" in href else "?") + "opds"
|
href += ("&" if "?" in href else "?") + "opds"
|
||||||
item["href"] = href
|
item["href"] = href
|
||||||
item["opds_id"] = uuid.uuid5(uuid.NAMESPACE_URL, "%s/%s" % (vpath, item["name"])).urn
|
item["opds_id"] = uuid.uuid5(
|
||||||
|
uuid.NAMESPACE_URL, "%s/%s" % (vpath, item["name"])
|
||||||
|
).urn
|
||||||
item["iso8601"] = "%sZ" % (item["dt"].replace(" ", "T"),)
|
item["iso8601"] = "%sZ" % (item["dt"].replace(" ", "T"),)
|
||||||
|
|
||||||
for item in files:
|
for item in files:
|
||||||
href = item["href"]
|
href = item["href"]
|
||||||
href += ("&" if "?" in href else "?") + "dl"
|
href += ("&" if "?" in href else "?") + "dl"
|
||||||
item["href"] = href
|
item["href"] = href
|
||||||
item["opds_id"] = uuid.uuid5(uuid.NAMESPACE_URL, "%s/%s" % (vpath, item["name"])).urn
|
item["opds_id"] = uuid.uuid5(
|
||||||
|
uuid.NAMESPACE_URL, "%s/%s" % (vpath, item["name"])
|
||||||
|
).urn
|
||||||
item["iso8601"] = "%sZ" % (item["dt"].replace(" ", "T"),)
|
item["iso8601"] = "%sZ" % (item["dt"].replace(" ", "T"),)
|
||||||
|
|
||||||
if "rmagic" in self.vn.flags:
|
if "rmagic" in self.vn.flags:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue