mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MTP driver: Ignore errors when getting the driveinfo.calibre file from the device and simply regenerate it
This commit is contained in:
parent
d5c26cfa46
commit
e606618d04
@ -108,10 +108,12 @@ class MTP_DEVICE(BASE):
|
|||||||
f = storage.find_path((self.DRIVEINFO,))
|
f = storage.find_path((self.DRIVEINFO,))
|
||||||
dinfo = {}
|
dinfo = {}
|
||||||
if f is not None:
|
if f is not None:
|
||||||
stream = self.get_mtp_file(f)
|
|
||||||
try:
|
try:
|
||||||
|
stream = self.get_mtp_file(f)
|
||||||
dinfo = json.load(stream, object_hook=from_json)
|
dinfo = json.load(stream, object_hook=from_json)
|
||||||
except:
|
except:
|
||||||
|
prints('Failed to load existing driveinfo.calibre file, with error:')
|
||||||
|
traceback.print_exc()
|
||||||
dinfo = None
|
dinfo = None
|
||||||
if dinfo.get('device_store_uuid', None) is None:
|
if dinfo.get('device_store_uuid', None) is None:
|
||||||
dinfo['device_store_uuid'] = unicode(uuid.uuid4())
|
dinfo['device_store_uuid'] = unicode(uuid.uuid4())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user