aerkalov / ebooklib

Python E-book library for handling books in EPUB2/EPUB3 format -
https://ebooklib.readthedocs.io/
GNU Affero General Public License v3.0
1.47k stars 229 forks source link

Can't change the metadata #302

Open sayush opened 7 months ago

sayush commented 7 months ago

I have a few epubs (part of the same series) that I want to change the title. The title before running the script was The awesome series


book = epub.read_epub(f'normal-book.epub')
book.set_title("The awesomest book ever")
book.set_language("en")
book.add_item(epub.EpubNcx())
book.add_item(epub.EpubNav())
epub.write_epub(f'compiled/awesome-book.epub', book)

When I read the book with the script below, instead of seeing The awesomest book ever, I see The awesome series


book = epub.read_epub('compiled/awesome-book.epub')
print(book.title)

I'm confused with why is it not writing the title out. I'm using

ebooklib 0.18
python 3.10.13 (Conda on Windows 10)

Thanks.