rename --opds-allowed to --opds-exts

and volflag too
This commit is contained in:
AppleTheGolden 2025-09-22 16:06:27 +02:00
parent 2969d9ff92
commit d522116eeb
No known key found for this signature in database
GPG key ID: F6AC8A62154C42AA
4 changed files with 9 additions and 9 deletions

View file

@ -1058,7 +1058,7 @@ to unauthenticated requests and enable [filekeys](#filekeys) to prevent guessing
`-vbooks:books:r,ed:g:c,fk,opds` `-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 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 ## recent uploads

View file

@ -1435,7 +1435,7 @@ def add_smb(ap):
def add_opds(ap): def add_opds(ap):
ap2 = ap.add_argument_group("OPDS options") 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", 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): def add_handlers(ap):
ap2 = ap.add_argument_group("handlers (see --help-handlers)") ap2 = ap.add_argument_group("handlers (see --help-handlers)")

View file

@ -144,7 +144,7 @@ def vf_cmap() -> dict[str, str]:
"mte", "mte",
"mth", "mth",
"mtp", "mtp",
"opds_allowed", "opds_exts",
"xac", "xac",
"xad", "xad",
"xar", "xar",
@ -331,7 +331,7 @@ flagcats = {
}, },
"opds": { "opds": {
"opds": "enable 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": { "textfiles": {
"md_no_br": "newline only on double-newline or two tailing spaces", "md_no_br": "newline only on double-newline or two tailing spaces",

View file

@ -6575,11 +6575,11 @@ class HttpCli(object):
no_zip = bool(self._can_zip(vf)) no_zip = bool(self._can_zip(vf))
volflag_opds_allowed = vf.get("opds_allowed") volflag_opds_exts = vf.get("opds_exts")
if volflag_opds_allowed is not None: if volflag_opds_exts is not None:
opds_no_filter = len(volflag_opds_allowed) == 0 opds_no_filter = len(volflag_opds_exts) == 0
else: else:
opds_no_filter = len(self.args.opds_allowed) == 0 opds_no_filter = len(self.args.opds_exts) == 0
dirs = [] dirs = []
files = [] files = []
@ -6644,7 +6644,7 @@ class HttpCli(object):
ext = ptn_hr.sub("@", fn.rsplit(".", 1)[1]) ext = ptn_hr.sub("@", fn.rsplit(".", 1)[1])
if len(ext) > 16: if len(ext) > 16:
ext = 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 continue
else: else:
ext = "%" ext = "%"