From 4f88faf537f547d8d3ef1b4dd2f86668cfa2994c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 19 Feb 2008 16:56:57 +0000 Subject: [PATCH] Don't create sub directories when saving to single directory --- src/libprs500/library/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libprs500/library/database.py b/src/libprs500/library/database.py index 9e17886eca..f640784dbd 100644 --- a/src/libprs500/library/database.py +++ b/src/libprs500/library/database.py @@ -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)