mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix OPDS category links to composite columns
This commit is contained in:
parent
e1b25b6f52
commit
f2d0a45b01
@ -539,9 +539,14 @@ class OPDSServer(object):
|
|||||||
try:
|
try:
|
||||||
p = which.index(':')
|
p = which.index(':')
|
||||||
category = which[p+1:]
|
category = which[p+1:]
|
||||||
|
which = which[:p]
|
||||||
|
# This line will toss an exception for composite columns
|
||||||
which = int(which[:p])
|
which = int(which[:p])
|
||||||
except:
|
except:
|
||||||
raise cherrypy.HTTPError(404, 'Tag %r not found'%which)
|
# Might be a composite column, where we have the lookup key
|
||||||
|
if not (category in self.db.field_metadata and
|
||||||
|
self.db.field_metadata[category]['datatype'] == 'composite'):
|
||||||
|
raise cherrypy.HTTPError(404, 'Tag %r not found'%which)
|
||||||
|
|
||||||
categories = self.categories_cache(
|
categories = self.categories_cache(
|
||||||
self.get_opds_allowed_ids_for_version(version))
|
self.get_opds_allowed_ids_for_version(version))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user