From 394b93cb43943cbd65c8f3013cfdd087404807b4 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sat, 3 Jan 2009 18:04:19 -0500 Subject: [PATCH] Cybook driver: Set author correctly when no author is given --- src/calibre/devices/cybookg3/books.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/devices/cybookg3/books.py b/src/calibre/devices/cybookg3/books.py index 9a1689af0b..ed3df812db 100644 --- a/src/calibre/devices/cybookg3/books.py +++ b/src/calibre/devices/cybookg3/books.py @@ -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. @@ -55,9 +57,8 @@ class BookList(_BookList): # the filename without the extension 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, ""))