Hello.
Thanks for such a great plugin!.
I do know nothing at all about python language (so sorry if my changes are horrible), but anyway I did an small modification to your plugin for my own personal use.
This is because I wanted your plugin to remove certain files that bother me a lot within epub files. They are mostly covers with ads from webpages, or book resumes that had spanish file names and thus they were not deleted with "delete all jackets" option.
I changed file "jacket.py" lines 61 ~70 to the following:
Code:
def remove_all_jackets(container, log):
log('\tLooking for all jackets')
dirtied = False
for name in list(container.name_path_map.keys()):
if 'jacket' in name and name.endswith('.xhtml'):
data = container.get_parsed_etree(name)
if is_current_jacket(data) or is_legacy_jacket(data):
log('\t Jacket removed: ', name)
dirtied = True
container.delete_from_manifest(name)
for name in list(container.name_path_map.keys()):
if 'sinopsis' in name and name.endswith('.xhtml'):
data = container.get_parsed_etree(name)
log('\t Sinopsis jacket found: ', name)
dirtied = True
container.delete_from_manifest(name)
for name in list(container.name_path_map.keys()):
if 'Cubierta' in name and name.endswith('.xhtml'):
data = container.get_parsed_etree(name)
log('\t Cubierta jacket found: ', name)
dirtied = True
container.delete_from_manifest(name)
for name in list(container.name_path_map.keys()):
if 'titulo' in name and name.endswith('.xhtml'):
data = container.get_parsed_etree(name)
log('\t Titulo jacket found: ', name)
dirtied = True
container.delete_from_manifest(name)
return dirtied
This will delete files "sinopsis.xhtml", "cubierta.xhtml" and "titulo.xhtml". It has worked very well for my large collection of downloaded books where most of them had those files.
So, would you be so kind to consider in next version (or if you feel bored enough) to add one option to automatically delete certain files that match a given name?.
This can be useful for many countries where english is not the main language.
Thanks in advance and greetings from Spain.