mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-01 23:05:20 +01: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
1 changed files with 3 additions and 1 deletions
|
|
@ -108,10 +108,12 @@ def _update_drive_info(self, storage, location_code, name=None):
|
|||
f = storage.find_path((self.DRIVEINFO,))
|
||||
dinfo = {}
|
||||
if f is not None:
|
||||
stream = self.get_mtp_file(f)
|
||||
try:
|
||||
stream = self.get_mtp_file(f)
|
||||
dinfo = json.load(stream, object_hook=from_json)
|
||||
except:
|
||||
prints('Failed to load existing driveinfo.calibre file, with error:')
|
||||
traceback.print_exc()
|
||||
dinfo = None
|
||||
if dinfo.get('device_store_uuid', None) is None:
|
||||
dinfo['device_store_uuid'] = unicode(uuid.uuid4())
|
||||
|
|
|
|||
Loading…
Reference in a new issue