calibre-web icon indicating copy to clipboard operation
calibre-web copied to clipboard

Add Kindle-friendly browser interface

Open carderne opened this issue 11 months ago • 17 comments

Relevant issues

  • https://github.com/janeczku/calibre-web/issues/2723

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 avatar Feb 28 '24 18:02 carderne

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 avatar Feb 29 '24 11:02 carderne

(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 avatar Mar 01 '24 09:03 carderne

Have updated my fork a bit:

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

carderne avatar Apr 03 '24 12:04 carderne

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.

jamescochran avatar Apr 03 '24 20:04 jamescochran

@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.)

carderne avatar Apr 04 '24 10:04 carderne

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"!

DavidGriswoldTeacher avatar Apr 04 '24 11:04 DavidGriswoldTeacher

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 https://github.com/janeczku/calibre-web/issues/2723#issuecomment-2038092040

pnatel avatar Apr 04 '24 20:04 pnatel

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.

pnatel avatar Apr 04 '24 20:04 pnatel

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

carderne avatar Apr 05 '24 09:04 carderne

Kindle Oasis 3 20240405_083509

jamescochran avatar Apr 05 '24 12:04 jamescochran

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...

carderne avatar Apr 05 '24 16:04 carderne

Created a pull request to your repo with small changes: https://github.com/carderne/calibre-web/pull/1

pnatel avatar Apr 06 '24 04:04 pnatel

Great, exactly what I was looking for!

adrianelsener avatar Aug 18 '24 14:08 adrianelsener

@pnatel your change is now available (along with other upstream updates from calibre-web) on Docker now as the following image:

carderne/calibre-web:0.6.23

carderne avatar Aug 18 '24 15:08 carderne

@pnatel your change is now available (along with other upstream updates from calibre-web) on Docker now as the following image:

carderne/calibre-web:0.6.23

Thank you very much! I can confirm that it is working fine.

pnatel avatar Aug 18 '24 20:08 pnatel

I really hope this gets merged in! I set up a server for friends and this would be a huge help, and I'd rather not have to set up a fork. Thank you for all the hard work!

EnduringGuerila avatar Aug 20 '24 17:08 EnduringGuerila

@OzzieIsaacs sorry to bother: is there any chance of getting this (or something like it) merged, or should we put the effort in to automate building the fork?

carderne avatar Aug 20 '24 19:08 carderne