This commit is contained in:
Kovid Goyal 2013-09-18 17:00:59 +05:30
parent 455afaa08f
commit 07547628cc

View File

@ -202,11 +202,12 @@ class USBMS(CLI, Device):
if self.SCAN_FROM_ROOT: if self.SCAN_FROM_ROOT:
ebook_dir = self.normalize_path(prefix) ebook_dir = self.normalize_path(prefix)
else: else:
ebook_dir = self.normalize_path( \ ebook_dir = self.normalize_path(
os.path.join(prefix, *(ebook_dir.split('/'))) \ os.path.join(prefix, *(ebook_dir.split('/')))
if ebook_dir else prefix) if ebook_dir else prefix)
debug_print('USBMS: scan from root', self.SCAN_FROM_ROOT, ebook_dir) debug_print('USBMS: scan from root', self.SCAN_FROM_ROOT, ebook_dir)
if not os.path.exists(ebook_dir): continue if not os.path.exists(ebook_dir):
continue
# Get all books in the ebook_dir directory # Get all books in the ebook_dir directory
if self.SUPPORTS_SUB_DIRS or self.SUPPORTS_SUB_DIRS_FOR_SCAN: if self.SUPPORTS_SUB_DIRS or self.SUPPORTS_SUB_DIRS_FOR_SCAN:
# build a list of files to check, so we can accurately report progress # build a list of files to check, so we can accurately report progress
@ -237,7 +238,7 @@ class USBMS(CLI, Device):
need_sync = True need_sync = True
del bl[idx] del bl[idx]
debug_print('USBMS: count found in cache: %d, count of files in metadata: %d, need_sync: %s' % \ debug_print('USBMS: count found in cache: %d, count of files in metadata: %d, need_sync: %s' %
(len(bl_cache), len(bl), need_sync)) (len(bl_cache), len(bl), need_sync))
if need_sync: # self.count_found_in_bl != len(bl) or need_sync: if need_sync: # self.count_found_in_bl != len(bl) or need_sync:
if oncard == 'cardb': if oncard == 'cardb':