Cybook driver: Set author correctly when no author is given

This commit is contained in:
John Schember 2009-01-03 18:04:19 -05:00
parent 1d4c9a6022
commit 394b93cb43

View File

@ -42,6 +42,8 @@ class BookList(_BookList):
# Filter out anything that isn't in the list of supported ebook types
for book_type in EBOOK_TYPES:
for filename in fnmatch.filter(files, '*.%s' % (book_type)):
book_title = ''
book_author = ''
# Calibre uses a specific format for file names. They take the form
# title_-_author_number.extention We want to see if the file name is
# in this format.
@ -56,8 +58,7 @@ class BookList(_BookList):
else:
book_title = os.path.splitext(filename)[0].replace('_', ' ')
book_path = os.path.join(path, filename)
self.append(Book(book_path, book_title, book_author))
self.append(Book(os.path.join(path, filename), book_title, book_author))
def add_book(self, path, title):
self.append(Book(path, title, ""))