mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from custcol trunk
This commit is contained in:
commit
dc8e4c62a2
@ -262,7 +262,7 @@ class CustomColumns(object):
|
||||
'SELECT id FROM %s WHERE value=?'%table, (ex,), all=False)
|
||||
if ex != x:
|
||||
self.conn.execute(
|
||||
'UPDATE %s SET value=? WHERE id=?', (x, xid))
|
||||
'UPDATE %s SET value=? WHERE id=?'%table, (x, xid))
|
||||
else:
|
||||
xid = self.conn.execute(
|
||||
'INSERT INTO %s(value) VALUES(?)'%table, (x,)).lastrowid
|
||||
|
@ -315,10 +315,19 @@ class FieldMetadata(dict):
|
||||
for key in self._tb_cats:
|
||||
yield key
|
||||
|
||||
def itervalues(self):
|
||||
return self._tb_cats.itervalues()
|
||||
|
||||
def values(self):
|
||||
return self._tb_cats.values()
|
||||
|
||||
def iteritems(self):
|
||||
for key in self._tb_cats:
|
||||
yield (key, self._tb_cats[key])
|
||||
|
||||
def items(self):
|
||||
return list(self.iteritems())
|
||||
|
||||
def is_custom_field(self, key):
|
||||
return key.startswith(self.custom_field_prefix)
|
||||
|
||||
|
@ -289,6 +289,10 @@ class SchemaUpgrade(object):
|
||||
'''.format(tn=table_name, cn=column_name, vcn=view_column_name))
|
||||
self.conn.executescript(script)
|
||||
|
||||
for tn, cn in self.field_metadata.items():
|
||||
if tn != 'news':
|
||||
create_tag_browser_view(tn, cn[0], cn[1])
|
||||
for field in self.field_metadata.itervalues():
|
||||
if field['is_category'] and not field['is_custom'] and \
|
||||
field['table'] != 'news' and field['table'] is not None:
|
||||
cn = field['table'][:-1]
|
||||
if cn == 'serie':
|
||||
cn += 's'
|
||||
create_tag_browser_view(field['table'], cn, field['column'])
|
||||
|
@ -322,9 +322,17 @@ class OPDSServer(object):
|
||||
return self.get_opds_all_books(which, page_url, up_url,
|
||||
version=version, offset=offset)
|
||||
elif type_ == 'N':
|
||||
return self.get_opds_navcatalog(which)
|
||||
return self.get_opds_navcatalog(which, version=version, offset=offset)
|
||||
raise cherrypy.HTTPError(404, 'Not found')
|
||||
|
||||
def get_opds_navcatalog(self, which, version=0, offset=0):
|
||||
categories = self.categories_cache(
|
||||
self.get_opds_allowed_ids_for_version(version))
|
||||
if which not in categories:
|
||||
raise cherrypy.HTTPError(404, 'Category %r not found'%which)
|
||||
|
||||
|
||||
|
||||
def opds(self, version=0):
|
||||
version = int(version)
|
||||
if version not in BASE_HREFS:
|
||||
|
Loading…
x
Reference in New Issue
Block a user