Fix saving to disk (in a single directory) of books with no formats

This commit is contained in:
Kovid Goyal 2008-08-05 23:14:34 -07:00
parent 4dff7ecf95
commit 73e7c29de0

View File

@ -1413,7 +1413,10 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE;
mi.render(f)
f.close()
for fmt in self.formats(idx, index_is_id=index_is_id).split(','):
fmts = self.formats(idx, index_is_id=index_is_id)
if not fmts:
fmts = ''
for fmt in fmts.split(','):
data = self.format(idx, fmt, index_is_id=index_is_id)
fname = name +'.'+fmt.lower()
fname = sanitize_file_name(fname)