mirror of
https://github.com/9001/copyparty.git
synced 2026-06-18 20:22:27 -06:00
parent
27031f73be
commit
9068ec6a8e
|
|
@ -7187,18 +7187,19 @@ class HttpCli(object):
|
||||||
dirs = []
|
dirs = []
|
||||||
files = []
|
files = []
|
||||||
ptn_hr = RE_HR
|
ptn_hr = RE_HR
|
||||||
use_abs_url = (
|
use_abs_url = is_opds or (
|
||||||
not is_opds
|
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
|
|
||||||
and vpath
|
|
||||||
)
|
)
|
||||||
for fn in ls_names:
|
for fn in ls_names:
|
||||||
base = ""
|
base = ""
|
||||||
href = fn
|
href = fn
|
||||||
if use_abs_url:
|
if use_abs_url:
|
||||||
base = "/" + vpath + "/"
|
if is_opds:
|
||||||
|
base = self.args.SRS
|
||||||
|
if vpath:
|
||||||
|
base += vpath + "/"
|
||||||
|
else:
|
||||||
|
base = "/" + vpath + "/"
|
||||||
href = base + fn
|
href = base + fn
|
||||||
|
|
||||||
if fn in vfs_virt:
|
if fn in vfs_virt:
|
||||||
|
|
@ -7528,17 +7529,26 @@ 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_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["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["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:
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
<id>{{ opds_id }}</id>
|
||||||
|
<title>{{ opds_title | e }}</title>
|
||||||
<link rel="search"
|
<link rel="search"
|
||||||
href="{{ opds_osd | e }}"
|
href="{{ opds_osd | e }}"
|
||||||
type="application/opensearchdescription+xml"/>
|
type="application/opensearchdescription+xml"/>
|
||||||
{%- for d in dirs %}
|
{%- for d in dirs %}
|
||||||
<entry>
|
<entry>
|
||||||
|
<id>{{ d.opds_id }}</id>
|
||||||
<title>{{ d.name | e }}</title>
|
<title>{{ d.name | e }}</title>
|
||||||
<link rel="subsection"
|
<link rel="subsection"
|
||||||
href="{{ d.href | e }}"
|
href="{{ d.href | e }}"
|
||||||
|
|
@ -14,6 +17,7 @@
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- for f in files %}
|
{%- for f in files %}
|
||||||
<entry>
|
<entry>
|
||||||
|
<id>{{ f.opds_id }}</id>
|
||||||
<title>{{ f.name | e }}</title>
|
<title>{{ f.name | e }}</title>
|
||||||
<updated>{{ f.iso8601 }}</updated>
|
<updated>{{ f.iso8601 }}</updated>
|
||||||
<link rel="http://opds-spec.org/acquisition"
|
<link rel="http://opds-spec.org/acquisition"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue