From ea28355d2b7b7b39736b332b04c0ce87b5f76ff6 Mon Sep 17 00:00:00 2001 From: eracknaphobia Date: Wed, 11 Dec 2024 13:59:53 -0500 Subject: [PATCH] Add delay setting #4 --- addon.xml | 4 ++-- .../language/resource.language.en_gb/strings.po | 4 ++++ resources/lib/scores.py | 2 ++ resources/settings.xml | 12 ++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addon.xml b/addon.xml index 99e18c0..cffc256 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ Live scoring and game updates via kodi notifications - - Fixed for upstream api changes + - Add ability to set a delay before displaying notifications en all diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 9ca3098..d2c8f17 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -24,6 +24,10 @@ msgctxt "#30330" msgid "Seconds to Display" msgstr "" +msgctxt "#30335" +msgid "Seconds to Delay Notifictaions" +msgstr "" + msgctxt "#30340" msgid "Include Goal Description" msgstr "" diff --git a/resources/lib/scores.py b/resources/lib/scores.py index 590c9b7..3d0c7e0 100644 --- a/resources/lib/scores.py +++ b/resources/lib/scores.py @@ -237,6 +237,8 @@ def check_if_changed(self, new_item, old_item): if self.addon.getSetting(id="goal_desc") == 'true' and new_item['headshot'] != '': img = new_item['headshot'] if title is not None and message is not None: + # Delay displaying notification X seconds + self.monitor.waitForAbort(int(self.addon.getSetting(id="delay_seconds"))) self.notify(title, message, img) self.monitor.waitForAbort(self.display_seconds + 5) diff --git a/resources/settings.xml b/resources/settings.xml index 5ecada9..0bf25e5 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -24,6 +24,18 @@ false + + 0 + 0 + + 0 + 5 + 180 + + + false + + 0 true