From d522116eeb930633e3b5eeb146e4fb9f80a2c8fe Mon Sep 17 00:00:00 2001 From: AppleTheGolden Date: Mon, 22 Sep 2025 16:06:27 +0200 Subject: [PATCH] rename --opds-allowed to --opds-exts and volflag too --- README.md | 2 +- copyparty/__main__.py | 2 +- copyparty/cfg.py | 4 ++-- copyparty/httpcli.py | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e3924737..7a947463 100644 --- a/README.md +++ b/README.md @@ -1058,7 +1058,7 @@ to unauthenticated requests and enable [filekeys](#filekeys) to prevent guessing `-vbooks:books:r,ed:g:c,fk,opds` by default, not all file types will be listed in opds feeds. to change this, add the extension to -`--opds-allowed` (volflag: `opds_allowed`), or empty the list to list everything +`--opds-exts` (volflag: `opds_exts`), or empty the list to list everything ## recent uploads diff --git a/copyparty/__main__.py b/copyparty/__main__.py index cc87685c..a15ebf6d 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -1435,7 +1435,7 @@ def add_smb(ap): def add_opds(ap): ap2 = ap.add_argument_group("OPDS options") ap2.add_argument("--opds", action="store_true", help="enable opds -- allows e-book readers to browse and download files (volflag=opds)") - ap2.add_argument("--opds-allowed", metavar="T,T", type=u, default="epub,cbz,pdf", help="file formats to list in OPDS feeds; leave empty to show everything (volflag=opds_allowed)") + ap2.add_argument("--opds-exts", metavar="T,T", type=u, default="epub,cbz,pdf", help="file formats to list in OPDS feeds; leave empty to show everything (volflag=opds_exts)") def add_handlers(ap): ap2 = ap.add_argument_group("handlers (see --help-handlers)") diff --git a/copyparty/cfg.py b/copyparty/cfg.py index b9819496..2e92305a 100644 --- a/copyparty/cfg.py +++ b/copyparty/cfg.py @@ -144,7 +144,7 @@ def vf_cmap() -> dict[str, str]: "mte", "mth", "mtp", - "opds_allowed", + "opds_exts", "xac", "xad", "xar", @@ -331,7 +331,7 @@ flagcats = { }, "opds": { "opds": "enable OPDS", - "opds_allowed": "file formats to list in OPDS feeds; leave empty to show everything" + "opds_exts": "file formats to list in OPDS feeds; leave empty to show everything" }, "textfiles": { "md_no_br": "newline only on double-newline or two tailing spaces", diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 01ae392a..f4902e4b 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -6575,11 +6575,11 @@ class HttpCli(object): no_zip = bool(self._can_zip(vf)) - volflag_opds_allowed = vf.get("opds_allowed") - if volflag_opds_allowed is not None: - opds_no_filter = len(volflag_opds_allowed) == 0 + volflag_opds_exts = vf.get("opds_exts") + if volflag_opds_exts is not None: + opds_no_filter = len(volflag_opds_exts) == 0 else: - opds_no_filter = len(self.args.opds_allowed) == 0 + opds_no_filter = len(self.args.opds_exts) == 0 dirs = [] files = [] @@ -6644,7 +6644,7 @@ class HttpCli(object): ext = ptn_hr.sub("@", fn.rsplit(".", 1)[1]) if len(ext) > 16: ext = ext[:16] - if is_opds and not opds_no_filter and ext not in self.args.opds_allowed: + if is_opds and not opds_no_filter and ext not in self.args.opds_exts: continue else: ext = "%"