From 794f010dc082911c1d654d710e0db45d1236948f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Nov 2011 11:36:00 +0530 Subject: [PATCH] ... --- src/calibre/library/database2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index bc503aef08..f19db7a33f 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1317,9 +1317,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): if path is None: path = os.path.join(self.library_path, self.path(id, index_is_id=True)) name = self.conn.get('SELECT name FROM data WHERE book=? AND format=?', (id, format), all=False) - if name: - if not replace: - return False + if name and not replace: + return False name = self.construct_file_name(id) ext = ('.' + format.lower()) if format else '' dest = os.path.join(path, name+ext)