Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kindle-friendly browser interface #3008

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

carderne
Copy link

@carderne carderne commented Feb 28, 2024

Relevant issues

Background

It would be great to be able to use calibre-web from a Kindle and directly download books. My current flow is to use calibre-web to manage/explore books, and then a separate process to get the book onto the Kindle.

Description

This PR adds two new routes:

  • /basic?query=<term>: equivalent of /search
  • /basic_book/<id>: equivalent of /book/<id>

They have no CSS or JavaScript and very basic structure. This is aimed at creating a page that the Kindle web browser can easily handle.

The only features that are maintained:

  • login (this page is unchanged)
  • logout from every page
  • simple search
  • book list with <authors> - <title>
  • book detail view with download links

Comments

I went as basic as possible to create a small diff, demonstrate the purpose, and create a tiny maintenance surface area if this gets merged.

Some functionality could be added back, but it's a trade-off with the limited browser. Search, select and download is all I need, but others may have different requirements.

Obviously happy to implement this in a different way if you think preferable!

Screenshots

Search page, after searching

home-screenshot

Book detail page

detail-screenshot

@carderne
Copy link
Author

If anyone wants to try this out with Docker, I've made a custom Docker image carderne/calibre-web based on the linuxserver one but with this modification.

The only difference is these two extra pages /basic and /basic_book. If this change doesn't fit with the main calibre-web project, I'll try to periodically keep the fork up-to-date with upstream, which should be quite straight-forward.

janeczku I've read your README update so I won't expect a prompt response. Let me know if the naming of the forked Docker image or anything else rankles and I'll be happy to change it.

@carderne
Copy link
Author

carderne commented Mar 1, 2024

(Could also do this with by detecting the Kindle User-Agent, but that would involve changing the main routes, so I've left it with this light-touch method for now...)

@carderne
Copy link
Author

carderne commented Apr 3, 2024

Have updated my fork a bit:

  1. Improved CSS
  2. Added images
  3. Added pagination and a home button

@jamescochran
Copy link

This is great! Exactly what I was looking for. The search box is a bit wonky as well as logout appears under home but I assume it should be on the far right. But all in all it does what I was looking for and that was to grab a book from my Calibre library through the Kindle browser.

@carderne
Copy link
Author

carderne commented Apr 4, 2024

@jamescochran
I had only tested on the latest Kindle Paperwhite, just used an older one and realised it doesn't support flexbox...

Have updated my fork to only use old-school CSS, please try again!
(The Docker image is now carderne/calibre-web:0.6.21-3 if that's what you're using.)

@DavidGriswoldTeacher
Copy link

Very nice! I like it a lot.

As a Kobo user who prefers this simple system over the more complex kobo syncing, I might at some point fork this myself and try to figure out how to add a link that will download epub in kepub format. I think the logic on this would be...

  1. If the kepub is there, just include its link as normal, but with the logic necessary to convert the download link from .kepub to .kepub.epub (a requirement for the kobo browser to download it). This is a bit broken on the main code right now.

  2. If the .kepub is NOT there, include a link that will convert the epub to kepub using kepubify, then download the .kepub.epub file

this is not a feature request, just thinking "aloud"!

@pnatel
Copy link

pnatel commented Apr 4, 2024

Same as @jamescochran with the only difference being that I don't have the login/logout option. I think it may be because I have the anonymous login enabled.
I also have some screenshots for reference in #2723 (comment)

@pnatel
Copy link

pnatel commented Apr 4, 2024

quick update, just installed carderne/calibre-web:0.6.21-3 and the search button is in the proper place.

The size of the search elements looks off, but I guess that this is caused by the way the Kindle browser renders that type of object, or it is getting that from the main site.

@carderne
Copy link
Author

carderne commented Apr 5, 2024

@pnatel can you share a photo of what you mean about "the search elements look off"? Maybe I can fix that.

@jamescochran
Copy link

jamescochran commented Apr 5, 2024

Kindle Oasis 3
20240405_083509

@carderne
Copy link
Author

carderne commented Apr 5, 2024

Oh damn ok I tested with an old-style Paperwhite and the new Paperwhite, but that's a third target. Not sure how I'll fix that without an Oasis to hand. Any chance you'd be able to run calibre-web locally and fiddle with the CSS?

The <nav> has a fixed height: 50px set, but Kindle's seem to treat px in mysterious ways... It might be as simple as setting it to 3rem or something like that. Alternatively, set a height on the <input element as well maybe...

@pnatel
Copy link

pnatel commented Apr 6, 2024

Created a pull request to your repo with small changes:
carderne#1

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.

None yet

4 participants