diff --git a/src/calibre/devices/prs505/driver.py b/src/calibre/devices/prs505/driver.py index da1ef55786..c97c3dc2d8 100644 --- a/src/calibre/devices/prs505/driver.py +++ b/src/calibre/devices/prs505/driver.py @@ -57,6 +57,7 @@ class PRS505(USBMS): MUST_READ_METADATA = True SUPPORTS_USE_AUTHOR_SORT = True EBOOK_DIR_MAIN = 'database/media/books' + SCAN_FROM_ROOT = True ALL_BY_TITLE = _('All by title') ALL_BY_AUTHOR = _('All by author') diff --git a/src/calibre/devices/usbms/driver.py b/src/calibre/devices/usbms/driver.py index 578c28b894..a391b88972 100644 --- a/src/calibre/devices/usbms/driver.py +++ b/src/calibre/devices/usbms/driver.py @@ -55,6 +55,8 @@ class USBMS(CLI, Device): METADATA_CACHE = 'metadata.calibre' DRIVEINFO = 'driveinfo.calibre' + SCAN_FROM_ROOT = False + def _update_driveinfo_record(self, dinfo, prefix, location_code, name=None): if not isinstance(dinfo, dict): dinfo = {} @@ -173,7 +175,10 @@ class USBMS(CLI, Device): ebook_dirs = [ebook_dirs] for ebook_dir in ebook_dirs: ebook_dir = self.path_to_unicode(ebook_dir) - ebook_dir = self.normalize_path( \ + if self.SCAN_FROM_ROOT: + ebook_dir = self.normalize_path(prefix) + else: + ebook_dir = self.normalize_path( \ os.path.join(prefix, *(ebook_dir.split('/'))) \ if ebook_dir else prefix) if not os.path.exists(ebook_dir): continue