本文整理汇总了Python中DPH_Singleton.Singleton.getSelectedSubtitleDataById方法的典型用法代码示例。如果您正苦于以下问题:Python Singleton.getSelectedSubtitleDataById方法的具体用法?Python Singleton.getSelectedSubtitleDataById怎么用?Python Singleton.getSelectedSubtitleDataById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DPH_Singleton.Singleton
的用法示例。
在下文中一共展示了Singleton.getSelectedSubtitleDataById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RemoteHandler
# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import getSelectedSubtitleDataById [as 别名]
#.........这里部分代码省略.........
if "offset" in params:
offset = int(params["offset"])
else:
offset = 0
machineIdentifier = params["machineIdentifier"]
printl("target machineIdentifier: " + str(machineIdentifier), self, "D")
for serverConfig in config.plugins.dreamplex.Entries:
printl("current machineIdentifier: " + str(serverConfig.machineIdentifier.value), self, "D")
if machineIdentifier in serverConfig.machineIdentifier.value:
printl("we have a match ...", self, "D")
self.g_serverConfig = serverConfig
self.plexInstance = Singleton().getPlexInstance(PlexLibrary(self.session, self.g_serverConfig, self.currentCompleteAddress, machineIdentifier))
listViewList, mediaContainer = self.plexInstance.getMixedContentFromSection(self.currentProtocol + "://" + self.currentAddress + ":" + self.currentPort + self.currentKey, fromRemotePlayer=True)
autoPlayMode = False
if offset > 0:
forceResume = True
else:
forceResume = False
resumeMode = False # this is always false because the ios and android app ask itself if we want to resume :-) no need to ask second time
playbackMode = self.g_serverConfig.playbackType.value
currentIndex = 0
libraryName = "Mixed"
splittedData = self.currentKey.split("/")
subtitleData = self.plexInstance.getSelectedSubtitleDataById(self.currentCompleteAddress, splittedData[-1])
data = {"command": "playMedia", "currentKey": self.currentKey, "listViewList": listViewList, "mediaContainer": mediaContainer, "autoPlayMode": autoPlayMode, "forceResume": forceResume, "resumeMode": resumeMode, "playbackMode": playbackMode, "currentIndex": currentIndex, "libraryName": libraryName, "subtitleData": subtitleData }
self.playerCallback(data)
self.resetCallback()
else:
printl("no match ...", self, "D")
else:
self.response(getOKMsg(), getPlexHeaders())
except:
traceback.print_exc()
self.wfile.close()
printl("", self, "C")
return
try:
self.wfile.close()
except:
pass
printl("", self, "C")
#===========================================================================
#
#===========================================================================
def resetCallback(self):
# we do this due to the fact that the messagepump is triggered mor often than we want to via playercallback for this reason we set to idle so that for example playMedia command is not called more than once
data = {"command": "idle"}
self.playerCallback(data)