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

Support usage of empty pre-created database

Open Dunrar opened this issue 2 years ago • 2 comments

Calibre-Web only allows the usage of a database pre-created via Calibre. Some users may not be in need of all the advanced features of Calibre, and might not even have used it before. But they would have to install it nonetheless, just to create a database.

In order to circumvent this, this PR simply adds an empty, pre-created database to the source. When choosing a directory with no metadata.db file in it, the user is asked if he or she wants to "create" one. The database template is then simply copied over to the destination. Fixes #2403.

This implementation works, but is very basic. Some ideas that maybe should be discussed:

  • Download the DB file instead of putting it in the source
  • Add a Create Database button to the filechooser_modal -> Question: How/Where should error messages be displayed?
  • Change implementation to use an /ajax/db_create route

Dunrar avatar May 22 '22 16:05 Dunrar

I think we should handle it easy and don't program some highly sophisticated functions into the code, but just have a link to a database file in the readme, so people can download it manually and put it wherever they want. This would be simple and easy to "program"

OzzieIsaacs avatar May 24 '22 08:05 OzzieIsaacs

Thanks for the feedback! I agree, simpler is better. But I also think there is a usability argument to be made for installing and using Calibre-Web without having to go through too much of the documentation. This PR doesn't add that much code and I think is a good tradeoff to make regarding simplicity of the code and ease of use. It's up to you, of course.

Edit: @OzzieIsaacs if this is a definite no from you I'll close the PR, but I would really like this to be merged/implemented. Thank you!

Dunrar avatar May 24 '22 09:05 Dunrar

I created a empty metadata.db from calibre and added it to the repository. Let's check if this helps.

OzzieIsaacs avatar Jan 30 '23 09:01 OzzieIsaacs

In case anybody's wondering, the empty database file is here: https://github.com/janeczku/calibre-web/blob/master/library/metadata.db

You can download it by clicking the download icon in the web bui - it's on the right side.

The commit is https://github.com/janeczku/calibre-web/commit/e71a3452e19e3631a492a143c3ddde60c10578bc

sethidden avatar Jul 08 '23 18:07 sethidden