Skip to content

feat: initial support for books#1035

Open
Bnyro wants to merge 6 commits intosbondCo:devfrom
Bnyro:books
Open

feat: initial support for books#1035
Bnyro wants to merge 6 commits intosbondCo:devfrom
Bnyro:books

Conversation

@Bnyro
Copy link
Copy Markdown

@Bnyro Bnyro commented Mar 12, 2026

Changes made

  • this adds support for books via OpenLibrary
  • the only UI part of this that is already working is the search (UI icon still buggy though, will fix that later)
  • the backend part should be close to done (I still have to create the router for book details and author details, but the OpenLibrary API client I implemented already supports it, so it should be easy enough)

Notes

I'm already opening this to share my progress and hopefully get some feedback if this is going into the right direction or if there's something fundamentally wrong with my logic?

Anyways this took much longer than I expected (already worked more than 6 hours on this), so taking some break now. Not sure when I find time to continue working on this, probably some time next week.

(one day) closes #382

PS: I noticed that the development guide doesn't work, as there's no server command in package.json. I've used the steps from the installation instructions now for testing it which worked fine.

PPS: I'll remove the when library dependency again probably, it doesn't seem like it's able to properly parse the date format from OpenLibrary anyways.

(Note to self: OpenLibrary docs are at https://openlibrary.org/developers/api)

@Bnyro
Copy link
Copy Markdown
Author

Bnyro commented Mar 17, 2026

Okay, we're getting closer. Below a list of what still doesn't work:

  • Ratings don't work yet, e.g. giving a thumbs up to a book does nothing yet (although in theory, the required code is already there, but there's still something broken)
  • The date parsing library (when) should be replaced by something that actually works

Open questions (what's your opinion about that @IRHM?):

  • Maybe add an author search route? Currently, I only added a book searching route, I'm not sure if author search is worth it.
  • Biographies returned by OpenLibrary are in Markdown format, but we currently show it as plain text instead of rendering it as HTML. To support rendering properly, we would need to add a dependency to something like https://github.com/gomarkdown/markdown.

@IRHM
Copy link
Copy Markdown
Member

IRHM commented Mar 17, 2026

* Maybe add an author search route? Currently, I only added a book searching route, I'm not sure if author search is worth it.

Book searching is probably good enough for now, if you want to add author searching feel free, though we may need to think about how it will be displayed in the UI since we already have a 'People' filter.

* Biographies returned by OpenLibrary are in Markdown format, but we currently show it as plain text instead of rendering it as HTML. To support rendering properly, we would need to add a dependency to something like https://github.com/gomarkdown/markdown.

I didn't expect they'd use markdown, I guess we should add parsing to html.

I don't mind if you do this in this PR or if we leave it for a later date, since it looks like most authors don't have any formatting for their bio (?), and it's no big deal since we can always add it in in the future.

If you do decide to add it in, we should probably add sanitization, like how gomarkdown describes: https://github.com/gomarkdown/markdown?tab=readme-ov-file#sanitize-untrusted-content

I haven't looked into it too much, but this library may be better (im basing that off stars and because hugo uses it): https://github.com/yuin/goldmark/

@Bnyro
Copy link
Copy Markdown
Author

Bnyro commented Mar 17, 2026

Book searching is probably good enough for now, if you want to add author searching feel free,

Yeah, I don't think it's worth it either, so I'm fine with not adding it. Actually, if searching e.g. "Dan Brown" in the books section, it already returns books by that author, so there's really no need for an additional author search.

since it looks like most authors don't have any formatting for their bio (?)

I think the book storylines use Markdown, and not the biographies that. Probably mixed that up, sorry. About half of them used Markdown iirc.

If you do decide to add it in, we should probably add sanitization, like how gomarkdown describes:

Yeah, we should definitely do that. I'll look into the Markdown rendering the coming days (probably tomorrow)

@Bnyro Bnyro marked this pull request as ready for review March 18, 2026 09:49
@Bnyro Bnyro changed the title [WIP] feat: initial support for books feat: initial support for books Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking of book reading

2 participants