mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5225 (IndexError returned for metadata lookup with ISBN and blank author)
This commit is contained in:
parent
64c423ba08
commit
6463f7cd4c
@ -553,7 +553,10 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
|||||||
def fetch_metadata(self):
|
def fetch_metadata(self):
|
||||||
isbn = re.sub(r'[^0-9a-zA-Z]', '', unicode(self.isbn.text()))
|
isbn = re.sub(r'[^0-9a-zA-Z]', '', unicode(self.isbn.text()))
|
||||||
title = qstring_to_unicode(self.title.text())
|
title = qstring_to_unicode(self.title.text())
|
||||||
author = string_to_authors(unicode(self.authors.text()))[0]
|
try:
|
||||||
|
author = string_to_authors(unicode(self.authors.text()))[0]
|
||||||
|
except IndexError:
|
||||||
|
author = ''
|
||||||
publisher = qstring_to_unicode(self.publisher.currentText())
|
publisher = qstring_to_unicode(self.publisher.currentText())
|
||||||
if isbn or title or author or publisher:
|
if isbn or title or author or publisher:
|
||||||
d = FetchMetadata(self, isbn, title, author, publisher, self.timeout)
|
d = FetchMetadata(self, isbn, title, author, publisher, self.timeout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user