Server OPDS feeds: Fix incorrect count of authors reported when there are lowercased author names. Fixes #1703251 [Calibre OPDS server cannot show more than 30 authors at a time](https://bugs.launchpad.net/calibre/+bug/1703251)

This commit is contained in:
Kovid Goyal 2017-07-10 22:46:39 +05:30
parent 3af4b40f41
commit 5dc7e8c16b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -453,7 +453,7 @@ def get_navcatalog(request_context, which, page_url, up_url, offset=0):
category_groups = OrderedDict() category_groups = OrderedDict()
for x in sorted(starts, key=sort_key): for x in sorted(starts, key=sort_key):
category_groups[x] = len([y for y in items if category_groups[x] = len([y for y in items if
getattr(y, 'sort', y.name).startswith(x)]) getattr(y, 'sort', y.name).upper().startswith(x)])
items = [Group(x, y) for x, y in category_groups.items()] items = [Group(x, y) for x, y in category_groups.items()]
max_items = request_context.opts.max_opds_items max_items = request_context.opts.max_opds_items
offsets = Offsets(offset, max_items, len(items)) offsets = Offsets(offset, max_items, len(items))