mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cybook driver: Set author correctly when no author is given
This commit is contained in:
parent
1d4c9a6022
commit
394b93cb43
@ -42,6 +42,8 @@ class BookList(_BookList):
|
|||||||
# Filter out anything that isn't in the list of supported ebook types
|
# Filter out anything that isn't in the list of supported ebook types
|
||||||
for book_type in EBOOK_TYPES:
|
for book_type in EBOOK_TYPES:
|
||||||
for filename in fnmatch.filter(files, '*.%s' % (book_type)):
|
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
|
# 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
|
# title_-_author_number.extention We want to see if the file name is
|
||||||
# in this format.
|
# in this format.
|
||||||
@ -56,8 +58,7 @@ class BookList(_BookList):
|
|||||||
else:
|
else:
|
||||||
book_title = os.path.splitext(filename)[0].replace('_', ' ')
|
book_title = os.path.splitext(filename)[0].replace('_', ' ')
|
||||||
|
|
||||||
book_path = os.path.join(path, filename)
|
self.append(Book(os.path.join(path, filename), book_title, book_author))
|
||||||
self.append(Book(book_path, book_title, book_author))
|
|
||||||
|
|
||||||
def add_book(self, path, title):
|
def add_book(self, path, title):
|
||||||
self.append(Book(path, title, ""))
|
self.append(Book(path, title, ""))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user