Skip to content

Conversation

@jlaunay
Copy link
Contributor

@jlaunay jlaunay commented Dec 11, 2025

Description was missing for most of my books.
I updated the parse_opf_metadata() function to use read_text() and extract the fields correctly and I also added strip_html_tags() to clean the descriptions.

I tested it on my collection and now I have a description for every book.

@paviro paviro added the enhancement New feature or request label Dec 11, 2025
@paviro paviro self-assigned this Dec 11, 2025
@paviro
Copy link
Owner

paviro commented Dec 11, 2025

Thank you will look into it later today!

@paviro
Copy link
Owner

paviro commented Dec 11, 2025

Made some changes, please have a look and tell me what you think.

I also think we should maybe keep some of the html tags no?

Apply quick_xml::escape::unescape to title, creator, publisher, language, subject, and identifier fields to ensure XML entities (e.g., &) are correctly decoded in all metadata properties, not just descriptions.
@paviro
Copy link
Owner

paviro commented Dec 11, 2025

Funny that I didn't even notice that at some point all the descriptions seem to have vanished 🙈

@paviro paviro merged commit 618b1ea into paviro:main Dec 11, 2025
@jlaunay
Copy link
Contributor Author

jlaunay commented Dec 11, 2025

I just tested the changes you made to my fix and it's perfect!
Even better since you keep the formatting.
When I saw there was a bug, instead of opening an issue, I preferred to try contributing and fixing it myself.
I went with the simplest solution by removing all the tags 😉

Thanks again for your reactivity!

"Although KOReader supports more than just EPUBs, this tool does not, and probably never will, as I don't use them and this is a weekend project that probably won't be maintained much."

PS: I think you can remove this sentence in the README.md now 🤣

@paviro
Copy link
Owner

paviro commented Dec 11, 2025

I love that you did! Not only did you find the issue that I didn't see haha you also fixed it! I also fixed some issues with escaped & etc in genre tags.

Haha true yes I probably can :D but I still think I proably will only support epub :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants