mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Don't create sub directories when saving to single directory
This commit is contained in:
parent
1bc13335a2
commit
4f88faf537
@ -1308,13 +1308,13 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE;
|
||||
by_author[au].append(index)
|
||||
for au in by_author.keys():
|
||||
apath = os.path.join(dir, sanitize_file_name(au))
|
||||
if not os.path.exists(apath):
|
||||
if not single_dir and not os.path.exists(apath):
|
||||
os.mkdir(apath)
|
||||
for idx in by_author[au]:
|
||||
title = re.sub(r'\s', ' ', self.title(idx))
|
||||
tpath = os.path.join(apath, sanitize_file_name(title))
|
||||
id = str(self.id(idx))
|
||||
if not os.path.exists(tpath):
|
||||
if not single_dir and not os.path.exists(tpath):
|
||||
os.mkdir(tpath)
|
||||
mi = OPFCreator(self.get_metadata(idx))
|
||||
cover = self.cover(idx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user