Content server: Fix OPDS feed for category based browsing listing restricted books, even though these books cannot be actually downloaded. Fixes #1839173 [opds feed shows other books with same tags when those books are not allowed.](https://bugs.launchpad.net/calibre/+bug/1839173)

This commit is contained in:
Kovid Goyal 2019-08-07 19:44:21 +05:30
parent bf8059aeb0
commit b4a8771232
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -566,7 +566,7 @@ def opds_category(ctx, rd, category, which):
q = category q = category
if q == 'news': if q == 'news':
q = 'tags' q = 'tags'
ids = rc.db.get_books_for_category(q, which) ids = rc.db.get_books_for_category(q, which) & rc.allowed_book_ids()
sort_by = 'series' if category == 'series' else 'title' sort_by = 'series' if category == 'series' else 'title'
return get_acquisition_feed(rc, ids, offset, page_url, up_url, 'calibre-category:'+category+':'+unicode_type(which), sort_by=sort_by) return get_acquisition_feed(rc, ids, offset, page_url, up_url, 'calibre-category:'+category+':'+unicode_type(which), sort_by=sort_by)