From c550d6c90d680120f92cf8696947a539c53eeacf Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 28 Oct 2023 07:50:01 +0200 Subject: [PATCH] Fix comic reader arrow visiblilty for one paged comic files Changed logging during kobo sync --- cps/kobo.py | 2 +- cps/static/js/kthoom.js | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cps/kobo.py b/cps/kobo.py index ee394509..0a968081 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -315,7 +315,7 @@ def generate_sync_response(sync_token, sync_results, set_cont=False): extra_headers["x-kobo-recent-reads"] = store_response.headers.get("x-kobo-recent-reads") except Exception as ex: - log.error("Failed to receive or parse response from Kobo's sync endpoint: {}".format(ex)) + log.error_or_exception("Failed to receive or parse response from Kobo's sync endpoint: {}".format(ex)) if set_cont: extra_headers["x-kobo-sync"] = "continue" sync_token.to_headers(extra_headers) diff --git a/cps/static/js/kthoom.js b/cps/static/js/kthoom.js index 33e4b2fc..67b18fc1 100644 --- a/cps/static/js/kthoom.js +++ b/cps/static/js/kthoom.js @@ -179,26 +179,23 @@ kthoom.ImageFile = function(file) { }; function updateDirectionButtons(){ - $("#right").show(); - $("#left").show(); + var left, right = 1; if (currentImage == 0 ) { if (settings.direction === 0) { - $("#right").show(); - $("#left").hide(); + left = 0; } else { - $("#left").show(); - $("#right").hide(); + right = 0; } } if ((currentImage + 1) >= Math.max(totalImages, imageFiles.length)) { if (settings.direction === 0) { - $("#left").show(); - $("#right").hide(); + right = 0; } else { - $("#right").show(); - $("#left").hide(); - } + left = 0; + } } + left === 1 ? $("#left").show() : $("#left").hide(); + right === 1 ? $("#right").show() : $("#right").hide(); } function initProgressClick() { $("#progress").click(function(e) {