From b2f469d4a20a1e73d57539b10fb3eacbd51aad8f Mon Sep 17 00:00:00 2001 From: Jason Hood Date: Mon, 7 Oct 2024 09:39:00 +1000 Subject: [PATCH] [imdb] Add "SubsSupport search" to context menu If SubsSupport is installed add a context menu item (between YTTrailer and the videos) to search for the title (and the original title). Closes #687. --- imdb/src/plugin.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/imdb/src/plugin.py b/imdb/src/plugin.py index 32025b48b..5f86f3501 100644 --- a/imdb/src/plugin.py +++ b/imdb/src/plugin.py @@ -650,6 +650,9 @@ def contextMenuPressed(self): (_("Search Trailer"), self.searchYttrailer), )) + if isPluginInstalled("SubsSupport"): + list.append((_("SubsSupport search"), self.searchSubsSupport)) + for video in self.videos: list.append((video[0], self.playVideo, video[1], video[2])) @@ -759,6 +762,19 @@ def searchYttrailer(self): self.session.open(YTTrailerList, self.eventName) + def searchSubsSupport(self): + try: + from Plugins.Extensions.SubsSupport.subtitles import E2SubsSeeker, SubsSearch, initSubsSettings + except ImportError as ie: + self["statusbar"].setText(_("SubsSupport import failed")) + return + + settings = initSubsSettings().search + titles = [self.eventName] + if self.originalName != self.eventName: + titles.append(self.originalName) + self.session.open(SubsSearch, E2SubsSeeker(self.session, settings), settings, searchTitles=titles, standAlone=True) + def openVirtualKeyBoard(self): self.session.openWithCallback( self.gotSearchString, @@ -974,6 +990,7 @@ def IMDBparse(self): tmd = {} self.eventName = get(fold, ('titleText', 'text')) + self.originalName = get(fold, ('originalTitleText', 'text')) self.titleId = get(fold, 'id') self["key_yellow"].setText(_("Details"))