standardebooks / web

The source code for the Standard Ebooks website.
https://standardebooks.org
Creative Commons Zero v1.0 Universal
234 stars 61 forks source link

Convert ebooks storage to the database #336

Open colagrosso opened 7 months ago

colagrosso commented 7 months ago

This is a large project that may require multiple issues, but we'll start here.

To help with the discussion, I have a draft PR at #335 where I hacked up a schema, script, methods, etc. for Ebooks and EbookTags. No hard feelings if we have to scrap that PR and start a different way.

Question:

Some notes about draft PR #335:

The more I look, the more work I see to do, but we'll chip away at it. One nice thing is that the ebook webpages are all read-only (unlike the artwork site).

colagrosso commented 7 months ago

I forgot to mention above, but I ran the script in #335 over a hundred or so ebooks, and it picked up the title, URL, and tags just fine. You can skip rebuilding the books and just update the database via:

for BOOK in $(find /standardebooks.org/ebooks -maxdepth 1 -type d)
do
  tsp nice /standardebooks.org/web/scripts/deploy-ebook-to-www -v --no-build --no-images --no-epubcheck --no-recompose --no-feeds --no-bulk-downloads --update-ebook-database $BOOK
done
acabal commented 7 months ago

For this project, I don't think we need one very large branch. Since we can do this piecemeal and release these updates as we make them, while still leaving the existing filesystem-based system in place to fill in the blanks, we can do each piece of work as its own PR.

acabal commented 7 months ago

I think we will probably drop Ebook::__construct() entirely in favor of several ::From* methods, like Ebook::FromFilesystem($path), Ebook::Get($ebookId), etc. much like Artwork.