From f72629027a9be928cd77764a198dedf470ec03af Mon Sep 17 00:00:00 2001 From: Heckie75 Date: Sun, 6 Aug 2023 10:09:07 +0200 Subject: [PATCH] [script.timers] 3.8.0 --- script.timers/addon.xml | 5 +++- .../resource.language.de_de/strings.po | 16 +++++++++++ .../resource.language.en_gb/strings.po | 16 +++++++++++ .../lib/contextmenu/set_quick_epg_timer.py | 27 ++++++++++++++++++- 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/script.timers/addon.xml b/script.timers/addon.xml index 6d57fdf989..acae017587 100644 --- a/script.timers/addon.xml +++ b/script.timers/addon.xml @@ -1,5 +1,5 @@ - + @@ -66,6 +66,9 @@ https://github.com/Heckie75/kodi-addon-timers https://github.com/Heckie75/kodi-addon-timers +v3.8.0 (2023-08-06) +- Context menu quicktimer: Added dialog if item is already scheduled and ask to replace or delete + v3.7.0 (2023-06-30) - If you stop explicitly playback while a start-stop-timer is running there won't be another stop action anymore when this timer runs out. - Added workaround that streamed video (probably mpeg-dash) immediately stops after timer has started (only happened if 'seek to correct time if timer starts belatedly' is activated) diff --git a/script.timers/resources/language/resource.language.de_de/strings.po b/script.timers/resources/language/resource.language.de_de/strings.po index bab6554415..3d953f08d7 100644 --- a/script.timers/resources/language/resource.language.de_de/strings.po +++ b/script.timers/resources/language/resource.language.de_de/strings.po @@ -625,6 +625,22 @@ msgctxt "#32258" msgid "No timers to select." msgstr "Es gibt noch keine Timer zur Auswahl." +msgctxt "#32260" +msgid "This item is already scheduled" +msgstr "Es gibt bereits einen Timer für diese Sendung" + +msgctxt "#32261" +msgid "What do you want to do with existing timer?" +msgstr "Was möchtest Du mit dem bestehenden Timer machen?" + +msgctxt "#32262" +msgid "Delete" +msgstr "Löschen" + +msgctxt "#32263" +msgid "Replace" +msgstr "Ersetzen" + msgctxt "#32270" msgid "Timer is ending with system action:" msgstr "Timer ended mit Systemaktion:" diff --git a/script.timers/resources/language/resource.language.en_gb/strings.po b/script.timers/resources/language/resource.language.en_gb/strings.po index e2f0cdeb88..a0d919b337 100644 --- a/script.timers/resources/language/resource.language.en_gb/strings.po +++ b/script.timers/resources/language/resource.language.en_gb/strings.po @@ -625,6 +625,22 @@ msgctxt "#32258" msgid "No timers to select." msgstr "" +msgctxt "#32260" +msgid "This item is already scheduled" +msgstr "" + +msgctxt "#32261" +msgid "What do you want to do with existing timer?" +msgstr "" + +msgctxt "#32262" +msgid "Delete" +msgstr "" + +msgctxt "#32263" +msgid "Replace" +msgstr "" + msgctxt "#32270" msgid "Timer is ending with system action:" msgstr "" diff --git a/script.timers/resources/lib/contextmenu/set_quick_epg_timer.py b/script.timers/resources/lib/contextmenu/set_quick_epg_timer.py index 7e65b923ed..1152df4633 100644 --- a/script.timers/resources/lib/contextmenu/set_quick_epg_timer.py +++ b/script.timers/resources/lib/contextmenu/set_quick_epg_timer.py @@ -1,9 +1,13 @@ +import xbmcgui from resources.lib.contextmenu.abstract_set_timer import (CONFIRM_YES, AbstractSetTimer) from resources.lib.timer.concurrency import (ask_overlapping_timers, get_next_higher_prio, get_next_lower_prio) from resources.lib.timer.timer import Timer +from resources.lib.utils.settings_utils import (CONFIRM_CUSTOM, CONFIRM_ESCAPE, + CONFIRM_NO, CONFIRM_YES, + trigger_settings_changed_event) class SetQuickEpgTimer(AbstractSetTimer): @@ -22,7 +26,28 @@ def perform_ahead(self, timer: Timer) -> bool: found = i if found != -1: - timer.id = timers[found].id + rv = xbmcgui.Dialog().yesnocustom(heading=self.addon.getLocalizedString(32260), + message="%s\n\n%s" % (timers[found].format("$L\n$H"), self.addon.getLocalizedString( + 32261)), + customlabel=self.addon.getLocalizedString( + 32262), + yeslabel=self.addon.getLocalizedString( + 32263), + nolabel=self.addon.getLocalizedString( + 32022) + ) + + if rv == CONFIRM_YES: + timer.id = timers[found].id + return True + + elif rv == CONFIRM_CUSTOM: + self.storage.delete_timer(timers[found].id) + trigger_settings_changed_event() + xbmcgui.Dialog().notification(self.addon.getLocalizedString( + 32000), self.addon.getLocalizedString(32029)) + + return False return True