From d59dff1fb4781aa7a7d8a3b4b1212695cee00b7f Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 6 Jan 2019 17:19:30 +0000 Subject: [PATCH 1/2] Fix /opds not respecting the 'advanced' displayed_fields option (Restrict displayed user-defined fields). --- src/calibre/srv/opds.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/srv/opds.py b/src/calibre/srv/opds.py index 903a1fd54b..c5320319cf 100644 --- a/src/calibre/srv/opds.py +++ b/src/calibre/srv/opds.py @@ -492,6 +492,8 @@ def opds(ctx, rd): return x for category in sorted(categories, key=lambda x: sort_key(getter(x))): + if not rc.ctx.is_field_displayable(category): + continue if len(categories[category]) == 0: continue if category in ('formats', 'identifiers'): From 7f6bc637339d98e3101e16be44e0785b6a949b4a Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 6 Jan 2019 21:07:30 +0000 Subject: [PATCH 2/2] Finish the fix for selecting custom fields in /opds --- src/calibre/srv/opds.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/srv/opds.py b/src/calibre/srv/opds.py index c5320319cf..be2fd0a4d3 100644 --- a/src/calibre/srv/opds.py +++ b/src/calibre/srv/opds.py @@ -491,8 +491,9 @@ def opds(ctx, rd): except KeyError: return x + fm = rc.db.field_metadata for category in sorted(categories, key=lambda x: sort_key(getter(x))): - if not rc.ctx.is_field_displayable(category): + if fm.is_ignorable_field(category) and not rc.ctx.is_field_displayable(category): continue if len(categories[category]) == 0: continue