mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix editing of custom is_multiple column when a value already exists
This commit is contained in:
parent
a83b7e89a0
commit
f8a9105001
@ -257,7 +257,7 @@ class CustomColumns(object):
|
|||||||
'SELECT id FROM %s WHERE value=?'%table, (ex,), all=False)
|
'SELECT id FROM %s WHERE value=?'%table, (ex,), all=False)
|
||||||
if ex != x:
|
if ex != x:
|
||||||
self.conn.execute(
|
self.conn.execute(
|
||||||
'UPDATE %s SET value=? WHERE id=?', (x, xid))
|
'UPDATE %s SET value=? WHERE id=?'%table, (x, xid))
|
||||||
else:
|
else:
|
||||||
xid = self.conn.execute(
|
xid = self.conn.execute(
|
||||||
'INSERT INTO %s(value) VALUES(?)'%table, (x,)).lastrowid
|
'INSERT INTO %s(value) VALUES(?)'%table, (x,)).lastrowid
|
||||||
|
@ -322,9 +322,17 @@ class OPDSServer(object):
|
|||||||
return self.get_opds_all_books(which, page_url, up_url,
|
return self.get_opds_all_books(which, page_url, up_url,
|
||||||
version=version, offset=offset)
|
version=version, offset=offset)
|
||||||
elif type_ == 'N':
|
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')
|
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):
|
def opds(self, version=0):
|
||||||
version = int(version)
|
version = int(version)
|
||||||
if version not in BASE_HREFS:
|
if version not in BASE_HREFS:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user