diff --git a/src/calibre/devices/kobo/books.py b/src/calibre/devices/kobo/books.py index 781562d091..7ee5beaec0 100644 --- a/src/calibre/devices/kobo/books.py +++ b/src/calibre/devices/kobo/books.py @@ -54,7 +54,8 @@ class Book(MetaInformation): except: self.datetime = time.gmtime() - self.thumbnail = ImageWrapper(thumbnail_name) + if thumbnail_name is not None: + self.thumbnail = ImageWrapper(thumbnail_name) self.tags = [] if other: self.smart_update(other) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 7a37cb19c9..ac782f2363 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -85,9 +85,11 @@ class KOBO(USBMS): idx = bl_cache.get(lpath, None) if idx is not None: - imagename = self.normalize_path(prefix + '.kobo/images/' + ImageID + ' - NickelBookCover.parsed') - #print "Image name Normalized: " + imagename - bl[idx].thumbnail = ImageWrapper(imagename) + if ImageID is not None: + imagename = self.normalize_path(self._main_prefix + '.kobo/images/' + ImageID + ' - NickelBookCover.parsed') + #print "Image name Normalized: " + imagename + if imagename is not None: + bl[idx].thumbnail = ImageWrapper(imagename) bl_cache[lpath] = None if ContentType != '6': if self.update_metadata_item(bl[idx]): @@ -341,6 +343,7 @@ class KOBO(USBMS): else: # if path.startswith("file:///mnt/onboard/"): path = path.replace("file:///mnt/onboard/", self._main_prefix) + path = path.replace("/mnt/onboard/", self._main_prefix) # print "Internal: " + filename return path