Save to disk: Dont error out if the user deletes all formats to be saved.

This commit is contained in:
Kovid Goyal 2017-11-15 08:10:03 +05:30
parent 0e79f5a1c3
commit 99452442df
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -204,7 +204,7 @@ class Saver(QObject):
def write_book(self, book_id, mi, components, fmts): def write_book(self, book_id, mi, components, fmts):
base_path = os.path.join(self.root, *components) base_path = os.path.join(self.root, *components)
base_dir = os.path.dirname(base_path) base_dir = os.path.dirname(base_path)
if self.opts.formats != 'all': if self.opts.formats and self.opts.formats != 'all':
asked_formats = {x.lower().strip() for x in self.opts.formats.split(',')} asked_formats = {x.lower().strip() for x in self.opts.formats.split(',')}
fmts = asked_formats.intersection(fmts) fmts = asked_formats.intersection(fmts)
if not fmts: if not fmts: