mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
a19f8999cc
commit
64a2cbc4e0
@ -190,15 +190,19 @@ class MTP_DEVICE(MTPDeviceBase):
|
||||
if len(storage) > 2:
|
||||
self._cardb_id = storage[2]['id']
|
||||
|
||||
files, errs = self.dev.get_filelist(self)
|
||||
if errs and not files:
|
||||
raise OpenFailed('Failed to read files from device. Underlying errors:\n'
|
||||
+self.format_errorstack(errs))
|
||||
folders, errs = self.dev.get_folderlist()
|
||||
if errs and not folders:
|
||||
raise OpenFailed('Failed to read folders from device. Underlying errors:\n'
|
||||
+self.format_errorstack(errs))
|
||||
self.filesystem_cache = FilesystemCache(files, folders)
|
||||
try:
|
||||
files, errs = self.dev.get_filelist(self)
|
||||
if errs and not files:
|
||||
raise OpenFailed('Failed to read files from device. Underlying errors:\n'
|
||||
+self.format_errorstack(errs))
|
||||
folders, errs = self.dev.get_folderlist()
|
||||
if errs and not folders:
|
||||
raise OpenFailed('Failed to read folders from device. Underlying errors:\n'
|
||||
+self.format_errorstack(errs))
|
||||
self.filesystem_cache = FilesystemCache(files, folders)
|
||||
except:
|
||||
self.dev = self._main_id = self._carda_id = self._cardb_id = None
|
||||
raise
|
||||
|
||||
@synchronous
|
||||
def get_device_information(self, end_session=True):
|
||||
|
Loading…
x
Reference in New Issue
Block a user