mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1900337 [Error when replacing db.prefs settings](https://bugs.launchpad.net/calibre/+bug/1900337)
This commit is contained in:
parent
f9dfae2bc9
commit
7b6ec6515a
@ -153,6 +153,13 @@ class ThreadSafePrefs(MutableMapping):
|
||||
prefs = self.db().backend.prefs
|
||||
return prefs.to_raw(val)
|
||||
|
||||
def raw_to_object(self, raw):
|
||||
if isinstance(raw, bytes):
|
||||
raw = raw.decode(preferred_encoding)
|
||||
import json
|
||||
from calibre.utils.config import from_json
|
||||
return json.loads(raw, object_hook=from_json)
|
||||
|
||||
|
||||
class LibraryDatabase(object):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user