This commit is contained in:
Kovid Goyal 2009-04-07 14:13:02 -07:00
parent c4f554dc0e
commit ceb3378d8c
3 changed files with 17 additions and 20 deletions

View File

@ -207,9 +207,9 @@ class MetaInformation(object):
title = mi.title
authors = mi.authors
self.title = title
self.author = list(authors) # Needed for backward compatibility
self.author = list(authors) if authors else []# Needed for backward compatibility
#: List of strings or []
self.authors = list(authors)
self.authors = list(authors) if authors else []
self.tags = getattr(mi, 'tags', [])
#: mi.cover_data = (ext, data)
self.cover_data = getattr(mi, 'cover_data', (None, None))

View File

@ -15,6 +15,7 @@ from calibre import terminal_controller, preferred_encoding
from calibre.utils.config import OptionParser, prefs
try:
from calibre.utils.single_qt_application import send_message
send_message
except:
send_message = None
from calibre.ebooks.metadata.meta import get_metadata

View File

@ -622,11 +622,7 @@ class LibraryDatabase2(LibraryDatabase):
if title:
if not isinstance(title, unicode):
title = title.decode(preferred_encoding, 'replace')
tf = FIELD_MAP['title']
q = title.lower()
for record in self.data._data:
if record is not None and record[tf].lower() == q:
return True
return bool(self.conn.get('SELECT id FROM books where title=?', (title,), all=False))
return False
def has_cover(self, index, index_is_id=False):