mirror of
https://github.com/9001/copyparty.git
synced 2025-11-24 07:23:22 -07:00
make ?zls response future-proof
This commit is contained in:
parent
2f7175f7f7
commit
bd6fba14f7
|
|
@ -1529,7 +1529,7 @@ class HttpCli(object):
|
|||
|
||||
try:
|
||||
with zipfile.ZipFile(abspath, "r") as zf:
|
||||
filelist = [f.filename for f in zf.infolist()]
|
||||
filelist = [{"fn": f.filename} for f in zf.infolist()]
|
||||
ret = json.dumps(filelist).encode("utf-8", "replace")
|
||||
self.reply(ret, mime="application/json")
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -235,11 +235,12 @@ window.baguetteBox = (function () {
|
|||
}
|
||||
})
|
||||
.then(function (fileList) {
|
||||
var imagesList = fileList.filter(function (name) {
|
||||
return name.indexOf(".") !== -1
|
||||
&& cbz_pics.indexOf(name.split(".").pop()) !== -1;
|
||||
}
|
||||
).sort();
|
||||
var imagesList = fileList.map(function (file) {
|
||||
return file["fn"];
|
||||
}).filter(function (file) {
|
||||
return file.indexOf(".") !== -1
|
||||
&& cbz_pics.indexOf(file.split(".").pop()) !== -1;
|
||||
}).sort();
|
||||
|
||||
if (imagesList.length === 0) {
|
||||
throw new Error("Archive does not contain any images");
|
||||
|
|
|
|||
Loading…
Reference in a new issue