Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[script.nhlscores@matrix] 2024.12.11+matrix.1 #2685

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script.nhlscores/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.nhlscores" name="NHL Scores" version="2023.12.27+matrix.1" provider-name="eracknaphobia">
<addon id="script.nhlscores" name="NHL Scores" version="2024.12.11+matrix.1" provider-name="eracknaphobia">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.pytz" />
Expand All @@ -12,7 +12,7 @@
<description lang="en_GB">Live scoring and game updates via kodi notifications
</description>
<news>
- Fixed for upstream api changes
- Add ability to set a delay before displaying notifications
</news>
<language>en</language>
<platform>all</platform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
2 changes: 2 additions & 0 deletions script.nhlscores/resources/lib/scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 12 additions & 0 deletions script.nhlscores/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
<popup>false</popup>
</control>
</setting>
<setting id="delay_seconds" type="integer" label="30335" help="">
<level>0</level>
<default>0</default>
<constraints>
<minimum>0</minimum>
<step>5</step>
<maximum>180</maximum>
</constraints>
<control type="slider" format="integer">
<popup>false</popup>
</control>
</setting>
<setting id="goal_desc" type="boolean" label="30340" help="">
<level>0</level>
<default>true</default>
Expand Down
Loading