janeczku / calibre-web

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

No cover and book if title contains ' #3057

Open Restil1789 opened 1 month ago

Restil1789 commented 1 month ago

Hello,

If my book title have a ' in his title the book is not working

500 Internal Server Error The server encountered an internal error and was unable to complete your request. There is an error in the application. Traceback (most recent call last): File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request() File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/app/calibre-web/cps/usermanagement.py", line 35, in decorated_view return login_required(func)(*args, *kwargs) File "/lsiopy/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view return current_app.ensure_sync(func)(args, kwargs) File "/app/calibre-web/cps/web.py", line 1140, in get_cover return get_book_cover(book_id, cover_resolution) File "/app/calibre-web/cps/helper.py", line 745, in get_book_cover return get_book_cover_internal(book, resolution=resolution) File "/app/calibre-web/cps/helper.py", line 786, in get_book_cover_internal return send_from_directory(cover_file_path, "cover.jpg") File "/lsiopy/lib/python3.10/site-packages/flask/helpers.py", line 557, in send_from_directory return werkzeug.utils.send_from_directory( # type: ignore[return-value] File "/lsiopy/lib/python3.10/site-packages/werkzeug/utils.py", line 576, in send_from_directory return send_file(path, environ, **kwargs) File "/lsiopy/lib/python3.10/site-packages/werkzeug/utils.py", line 479, in send_file file = open(path, "rb") # type: ignore FileNotFoundError: [Errno 2] No such file or directory: "/books/Korita/The Extra's Academy Survival Guide (501)/cover.jpg"

I am on windows, with the docker env

yunimoo commented 1 month ago

thanks will give this a look

yunimoo commented 1 month ago

Can't seem to replicate on my end. Are you adding the book through calibre or upload via calibre web? It seems like the cover.jpg is not found in that path based on your error logs. Does it actually exist in that path? I test uploaded an epub with a ' and was able to load up the book and cover.jpg.