mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
7f6d06709e
commit
0c4e86dcd1
@ -111,7 +111,10 @@ class DBPrefs(dict): # {{{
|
||||
if not self.disable_setting:
|
||||
raw = self.to_raw(val)
|
||||
with self.db.conn:
|
||||
dbraw = self.db.execute('SELECT id,val FROM preferences WHERE key=?', (key,)).fetchone()
|
||||
try:
|
||||
dbraw = self.db.execute('SELECT id,val FROM preferences WHERE key=?', (key,)).next()
|
||||
except StopIteration:
|
||||
dbraw = None
|
||||
if dbraw is None or dbraw[1] != raw:
|
||||
if dbraw is None:
|
||||
self.db.execute('INSERT INTO preferences (key,val) VALUES (?,?)', (key, raw))
|
||||
|
Loading…
x
Reference in New Issue
Block a user