Skip to content

Commit

Permalink
Fix filename callback
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoguen committed Aug 5, 2015
1 parent 81d4814 commit 64bfebd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common.py
Expand Up @@ -22,7 +22,7 @@
XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
configdir = os.path.join(config_dir, 'plugins')
reference_kepub = os.path.join(configdir, 'reference.kepub.epub')
plugin_version = (2, 5, 0)
plugin_version = (2, 5, 1)
plugin_minimum_calibre_version = (1, 3, 0)


Expand Down
12 changes: 8 additions & 4 deletions device/driver.py
Expand Up @@ -294,11 +294,15 @@ def upload_books(self, files, names, on_card=None, end_session=True, metadata=No
return super(KOBOTOUCHEXTENDED, self).upload_books(files, names, on_card, end_session, metadata)

def filename_callback(self, path, mi):
debug_print("KoboTouchExtended:filename_callback:Path - {0}".format(path))
if path.endswith(KEPUB_EXT):
path += EPUB_EXT
debug_print("KoboTouchExtended:filename_callback:New path - {0}".format(path))
opts = self.settings()
if opts.extra_customization[self.OPT_EXTRA_FEATURES]:
debug_print("KoboTouchExtended:filename_callback:Path - {0}".format(path))
if path.endswith(KEPUB_EXT):
path += EPUB_EXT
elif path.endswith(EPUB_EXT) and mi.uuid not in self.skip_renaming_files:
path = path.rstrip(EPUB_EXT) + KEPUB_EXT + EPUB_EXT

debug_print("KoboTouchExtended:filename_callback:New path - {0}".format(path))
return path

def sanitize_path_components(self, components):
Expand Down

0 comments on commit 64bfebd

Please sign in to comment.