From 75cb612cf9169ab51f85519410bbea51c2483019 Mon Sep 17 00:00:00 2001 From: jbleyel Date: Tue, 11 Jul 2023 14:55:39 +0200 Subject: [PATCH] [EPGSelection] * add TMDB Search --- lib/python/Components/UsageConfig.py | 2 ++ lib/python/Screens/EpgSelection.py | 30 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py index eeeb47463ac..8ae285e5a67 100755 --- a/lib/python/Components/UsageConfig.py +++ b/lib/python/Components/UsageConfig.py @@ -1820,6 +1820,7 @@ def autolanguagesub(configElement): ("autotimer", _("AutoTimer")), ("timer", _("Add/Remove Timer")), ("imdb", _("IMDb Search")), + ("tmdb", _("TMDB Search")), ("bouquetlist", _("Bouquet List")), ("showmovies", _("Show Movies List")), ("record", _("Record - same as record button")), @@ -1860,6 +1861,7 @@ def autolanguagesub(configElement): ("24plus", _("+24 Hours")), ("24minus", _("-24 Hours")), ("imdb", _("IMDb Search")), + ("tmdb", _("TMDB Search")), ("bouquetlist", _("Bouquet List")), ("showmovies", _("Show Movies List")), ("record", _("Record - same as record button")), diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py index 1434a62c5ee..778b791515a 100644 --- a/lib/python/Screens/EpgSelection.py +++ b/lib/python/Screens/EpgSelection.py @@ -971,6 +971,8 @@ def redButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.graph_red.value == "imdb" or config.epgselection.graph_red.value == None: self.openIMDb() + if config.epgselection.graph_red.value == "tmdb": + self.openTMDB() if config.epgselection.graph_red.value == "autotimer": self.addAutoTimer() if config.epgselection.graph_red.value == "bouquetlist": @@ -1000,6 +1002,8 @@ def redButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.vertical_red.value == "imdb" or config.epgselection.vertical_red.value == None: self.openIMDb() + if config.epgselection.vertical_red.value == "tmdb": + self.openTMDB() if config.epgselection.vertical_red.value == "autotimer": self.addAutoTimer() if config.epgselection.vertical_red.value == "bouquetlist": @@ -1040,6 +1044,8 @@ def greenButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.graph_green.value == "imdb": self.openIMDb() + if config.epgselection.graph_green.value == "tmdb": + self.openTMDB() if config.epgselection.graph_green.value == "autotimer": self.addAutoTimer() if config.epgselection.graph_green.value == "bouquetlist": @@ -1069,6 +1075,8 @@ def greenButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.vertical_green.value == "imdb" or config.epgselection.vertical_green.value == None: self.openIMDb() + if config.epgselection.vertical_green.value == "tmdb": + self.openTMDB() if config.epgselection.vertical_green.value == "autotimer": self.addAutoTimer() if config.epgselection.vertical_green.value == "bouquetlist": @@ -1109,6 +1117,8 @@ def yellowButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.graph_yellow.value == "imdb": self.openIMDb() + if config.epgselection.graph_yellow.value == "tmdb": + self.openTMDB() if config.epgselection.graph_yellow.value == "autotimer": self.addAutoTimer() if config.epgselection.graph_yellow.value == "bouquetlist": @@ -1138,6 +1148,8 @@ def yellowButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.vertical_yellow.value == "imdb" or config.epgselection.vertical_yellow.value == None: self.openIMDb() + if config.epgselection.vertical_yellow.value == "tmdb": + self.openTMDB() if config.epgselection.vertical_yellow.value == "autotimer": self.addAutoTimer() if config.epgselection.vertical_yellow.value == "bouquetlist": @@ -1171,6 +1183,8 @@ def blueButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.graph_blue.value == "imdb": self.openIMDb() + if config.epgselection.graph_blue.value == "tmdb": + self.openTMDB() if config.epgselection.graph_blue.value == "autotimer" or config.epgselection.graph_blue.value == None: self.addAutoTimer() if config.epgselection.graph_blue.value == "bouquetlist": @@ -1200,6 +1214,8 @@ def blueButtonPressed(self): self.RecordTimerQuestion(True) if config.epgselection.vertical_blue.value == "imdb" or config.epgselection.vertical_blue.value == None: self.openIMDb() + if config.epgselection.vertical_blue.value == "tmdb": + self.openTMDB() if config.epgselection.vertical_blue.value == "autotimer": self.addAutoTimer() if config.epgselection.vertical_blue.value == "bouquetlist": @@ -1288,6 +1304,20 @@ def openIMDb(self): except ImportError: self.session.open(MessageBox, _("The IMDb plugin is not installed!\nPlease install it."), type=MessageBox.TYPE_INFO, timeout=10) + def openTMDB(self): + try: + from Plugins.Extensions.tmdb.tmdb import tmdbScreen + try: + cur = self["list" + str(self.activeList)].getCurrent() + event = cur[0] + name = event.getEventName() + except: + name = "" + + self.session.open(tmdbScreen, name, 2) + except ImportError: + self.session.open(MessageBox, _("The TMDB plugin is not installed!\nPlease install it."), type=MessageBox.TYPE_INFO, timeout=10) + def openEPGSearch(self): try: from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch