This commit is contained in:
2024-03-09 21:18:02 +08:00
parent 8b2fc97f4e
commit 3888030eec
2 changed files with 11 additions and 0 deletions

View File

@@ -55,6 +55,10 @@ def export_chapter(ncw: NovelCiwei, db: CwmDb, cfg: Config, bn: BooksNew,
def export_book(ncw: NovelCiwei, db: CwmDb, cfg: Config, bn: BooksNew,
book_id: int):
book = ncw.get_book_in_shelf(book_id)
if book is None:
book = ncw.get_book_in_readhistory(book_id)
if book is None:
raise ValueError('The book is not found.')
if cfg.export_txt:
txt_filename = cfg.get_export_book(book, 'txt')
d = dirname(txt_filename)