From bd6fba14f7197b0060f7cf90f7c65ce0b01c4e55 Mon Sep 17 00:00:00 2001 From: AppleTheGolden Date: Sun, 12 Oct 2025 00:59:56 +0200 Subject: [PATCH] make ?zls response future-proof --- copyparty/httpcli.py | 2 +- copyparty/web/baguettebox.js | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 218b06cd..ca60f2f8 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -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 diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index eb46a917..cd140c9f 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -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");