當前位置: 首頁>>代碼示例>>Python>>正文


Python Singleton.getMixedContentFromSection方法代碼示例

本文整理匯總了Python中DPH_Singleton.Singleton.getMixedContentFromSection方法的典型用法代碼示例。如果您正苦於以下問題:Python Singleton.getMixedContentFromSection方法的具體用法?Python Singleton.getMixedContentFromSection怎麽用?Python Singleton.getMixedContentFromSection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DPH_Singleton.Singleton的用法示例。


在下文中一共展示了Singleton.getMixedContentFromSection方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: RemoteHandler

# 需要導入模塊: from DPH_Singleton import Singleton [as 別名]
# 或者: from DPH_Singleton.Singleton import getMixedContentFromSection [as 別名]

#.........這裏部分代碼省略.........
				offset =  params["offset"]
				data = {"command": "seekTo", "offset": offset}

				self.playerCallback(data)
				self.resetCallback()

			elif request_path == "player/playback/playMedia":
				self.response(getOKMsg(), getPlexHeaders())

				self.currentAddress = params.get('address', self.client_address[0])
				self.currentKey = params['key']
				self.currentPort = params['port']
				self.currentProtocol = params.get('protocol', "http")
				self.currentCompleteAddress = self.currentAddress + ":" + self.currentPort

				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
開發者ID:DonDavici,項目名稱:DreamPlex,代碼行數:70,代碼來源:DPH_RemoteHandler.py


注:本文中的DPH_Singleton.Singleton.getMixedContentFromSection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。