make ?zls response future-proof

This commit is contained in:
AppleTheGolden 2025-10-12 00:59:56 +02:00
parent 2f7175f7f7
commit bd6fba14f7
No known key found for this signature in database
GPG key ID: F6AC8A62154C42AA
2 changed files with 7 additions and 6 deletions

View file

@ -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

View file

@ -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");