From 0c27ff11b9522bc0324f48a70399540b63646bbd Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Wed, 1 Apr 2020 18:45:16 +0200 Subject: [PATCH] Update Updater --- cps/admin.py | 3 ++- cps/updater.py | 3 +++ cps/web.py | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index fa5b1caf..55a11c3e 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -964,7 +964,8 @@ def get_updater_status(): "8": _(u'Update failed:') + u' ' + _(u'HTTP Error'), "9": _(u'Update failed:') + u' ' + _(u'Connection error'), "10": _(u'Update failed:') + u' ' + _(u'Timeout while establishing connection'), - "11": _(u'Update failed:') + u' ' + _(u'General error') + "11": _(u'Update failed:') + u' ' + _(u'General error'), + "12": _(u'Update failed:') + u' ' + _(u'Update File Could Not be Saved in Temp Dir') } status['text'] = text updater_thread.status = 0 diff --git a/cps/updater.py b/cps/updater.py index 34f3ceef..0cc0c4f5 100644 --- a/cps/updater.py +++ b/cps/updater.py @@ -114,6 +114,9 @@ class Updater(threading.Thread): except (requests.exceptions.RequestException, zipfile.BadZipFile): self.status = 11 log.info(u'General error') + except (IOError, OSError): + self.status = 12 + log.info(u'Update File Could Not be Saved in Temp Dir') self.pause() return False diff --git a/cps/web.py b/cps/web.py index 8f273faf..b42fb0ce 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1039,11 +1039,11 @@ def serve_book(book_id, book_format, anyname): else: return send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format) - -@web.route("/download//") +@web.route("/download//", defaults={'anyname': 'None'}) +@web.route("/download///") @login_required_if_no_ano @download_required -def download_link(book_id, book_format): +def download_link(book_id, book_format, anyname): return get_download_link(book_id, book_format.lower())