Fix bug with html files not being displayed - Kobo does not generate an ImageID nad used a different ContentID format

This commit is contained in:
Timothy Legge 2010-07-08 22:14:34 -03:00
parent f4c2f69f9e
commit 3c59d2da7f
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -85,9 +85,11 @@ class KOBO(USBMS):
idx = bl_cache.get(lpath, None)
if idx is not None:
imagename = self.normalize_path(self._main_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