janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
13.17k stars 1.41k forks source link

Enable/Disable "Separate Book Files from Library" issue #3131

Closed castle-samj closed 1 week ago

castle-samj commented 3 months ago

Describe the bug/problem

If there is an invalid /path/to/altbooks in the input field for "Separate Book Files from Library" Calibre-Web will attempt to load from that path regardless of the tick box state.

To Reproduce

Steps to reproduce the behavior:

  1. On a working instance, logged in as an admin user..
  2. Go to Settings > Edit Calibre Database Configuration
  3. Select the box next to "Separate Book Files from Library"
  4. Input a directory that is not the same as the "Location of Calibre Database" 3.1. My exact change was in attempt to target a virtual library: "/path/to/Calibre-Library::virtual"
  5. Save the new configuration
  6. Deselect the tick box next to "Separate Book Files from Library" with the saved path still in the input field
  7. Save configuration again
  8. Load the a page with books to see a wall of "Cover Not Found"
  9. Return to the Settings > Edit Calibre Database Configuration page
  10. Select the tick box next to "Separate Book Files from Library"
  11. Clear all text from the input box and save the configuration
  12. Deselect the tick box next to "Separate Book Files from Library" and save configuration again
  13. Load a page with books to see all cover art loading correctly

Logfile

Multiple lines of the following, but nothing else: ... [2024-08-21 11:01:30,046] DEBUG {cps.tasks.thumbnail:175} Error updating book thumbnail: Book cover file not found ...

Expected behavior

Deselecting the tick box should result in not using the /path/to/altbooks dir, falling back to the base Calibre Database dir

Screenshots

N/A

Environment (please complete the following information):

Additional context None

OzzieIsaacs commented 3 months ago

Yeah I remember that the error handling in this cases was a bit tricky and I gave up at some point to check if it causes problems. I will have a look at it

OzzieIsaacs commented 3 months ago

Please check newest nightly version, it's now no longer possible to save a invalid path for split library location