Skip to content

Commit

Permalink
Merge pull request #689 from adoxa/imdb-subssupport
Browse files Browse the repository at this point in the history
[imdb] Add "SubsSupport search" to context menu
  • Loading branch information
jbleyel authored Oct 31, 2024
2 parents a1e8c52 + b2f469d commit 4904646
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions imdb/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 4904646

Please sign in to comment.