mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Don't print out error messages when no cache is present on a device
This commit is contained in:
parent
78bb3a2753
commit
38b1f35ff7
@ -277,8 +277,10 @@ class USBMS(CLI, Device):
|
|||||||
bl = []
|
bl = []
|
||||||
js = []
|
js = []
|
||||||
need_sync = False
|
need_sync = False
|
||||||
|
cache_file = cls.normalize_path(os.path.join(prefix, name))
|
||||||
|
if os.access(cache_file, os.R_OK):
|
||||||
try:
|
try:
|
||||||
with open(cls.normalize_path(os.path.join(prefix, name)), 'rb') as f:
|
with open(cache_file, 'rb') as f:
|
||||||
js = json.load(f, encoding='utf-8')
|
js = json.load(f, encoding='utf-8')
|
||||||
for item in js:
|
for item in js:
|
||||||
book = cls.book_class(prefix, item.get('lpath', None))
|
book = cls.book_class(prefix, item.get('lpath', None))
|
||||||
@ -290,6 +292,8 @@ class USBMS(CLI, Device):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
bl = []
|
bl = []
|
||||||
need_sync = True
|
need_sync = True
|
||||||
|
else:
|
||||||
|
need_sync = True
|
||||||
return bl, need_sync
|
return bl, need_sync
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user