This commit is contained in:
Kovid Goyal 2010-07-09 13:35:40 -06:00
commit 544b389674

View File

@ -227,12 +227,16 @@ class KOBO(USBMS):
#print "kobo book" #print "kobo book"
ContentType = 6 ContentType = 6
ContentID = self.contentid_from_path(path, ContentType) ContentID = self.contentid_from_path(path, ContentType)
if extension == '.pdf' or extension == '.epub': elif extension == '.pdf' or extension == '.epub':
# print "ePub or pdf" # print "ePub or pdf"
ContentType = 16 ContentType = 16
#print "Path: " + path #print "Path: " + path
ContentID = self.contentid_from_path(path, ContentType) ContentID = self.contentid_from_path(path, ContentType)
# print "ContentID: " + ContentID # print "ContentID: " + ContentID
else: # if extension == '.html' or extension == '.txt':
ContentType = 999 # Yet another hack: to get around Kobo changing how ContentID is stored
ContentID = self.contentid_from_path(path, ContentType)
ImageID = self.delete_via_sql(ContentID, ContentType) ImageID = self.delete_via_sql(ContentID, ContentType)
#print " We would now delete the Images for" + ImageID #print " We would now delete the Images for" + ImageID
self.delete_images(ImageID) self.delete_images(ImageID)
@ -316,6 +320,11 @@ class KOBO(USBMS):
ContentID = ContentID.replace(self._main_prefix, '') ContentID = ContentID.replace(self._main_prefix, '')
if self._card_a_prefix is not None: if self._card_a_prefix is not None:
ContentID = ContentID.replace(self._card_a_prefix, '') ContentID = ContentID.replace(self._card_a_prefix, '')
elif ContentType == 999: # HTML Files
ContentID = path
ContentID = ContentID.replace(self._main_prefix, "/mnt/onboard/")
if self._card_a_prefix is not None:
ContentID = ContentID.replace(self._card_a_prefix, "/mnt/sd/")
else: # ContentType = 16 else: # ContentType = 16
ContentID = path ContentID = path
ContentID = ContentID.replace(self._main_prefix, "file:///mnt/onboard/") ContentID = ContentID.replace(self._main_prefix, "file:///mnt/onboard/")