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:
|
try:
|
||||||
with zipfile.ZipFile(abspath, "r") as zf:
|
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")
|
ret = json.dumps(filelist).encode("utf-8", "replace")
|
||||||
self.reply(ret, mime="application/json")
|
self.reply(ret, mime="application/json")
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
|
|
@ -235,11 +235,12 @@ window.baguetteBox = (function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function (fileList) {
|
.then(function (fileList) {
|
||||||
var imagesList = fileList.filter(function (name) {
|
var imagesList = fileList.map(function (file) {
|
||||||
return name.indexOf(".") !== -1
|
return file["fn"];
|
||||||
&& cbz_pics.indexOf(name.split(".").pop()) !== -1;
|
}).filter(function (file) {
|
||||||
}
|
return file.indexOf(".") !== -1
|
||||||
).sort();
|
&& cbz_pics.indexOf(file.split(".").pop()) !== -1;
|
||||||
|
}).sort();
|
||||||
|
|
||||||
if (imagesList.length === 0) {
|
if (imagesList.length === 0) {
|
||||||
throw new Error("Archive does not contain any images");
|
throw new Error("Archive does not contain any images");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue