From e1843534933a22615adbf1e0a2f4fd852f360466 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Wed, 18 Dec 2024 22:34:03 -0800 Subject: [PATCH] Display toast notification longer --- comictaggerlib/taggerwindow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comictaggerlib/taggerwindow.py b/comictaggerlib/taggerwindow.py index 25986fc..feae78b 100644 --- a/comictaggerlib/taggerwindow.py +++ b/comictaggerlib/taggerwindow.py @@ -1152,7 +1152,8 @@ class TaggerWindow(QtWidgets.QMainWindow): def on_ratelimit(self, full_time: float, sleep_time: float) -> None: toast = Toast(self) - toast.setDuration(10000) + # Convert to milliseconds, make it end half a second before the ratelimit triggers again, make sure we have a positive time + toast.setDuration(abs(int(sleep_time * 1000) - 500)) toast.setTitle("Rate Limit Hit!") toast.setText( f"Rate limit reached: {full_time:.0f}s until next request. Waiting {sleep_time:.0f}s for ratelimit"