当前位置: 首页>>代码示例>>Python>>正文


Python Singleton.getMoviesFromSection方法代码示例

本文整理汇总了Python中DPH_Singleton.Singleton.getMoviesFromSection方法的典型用法代码示例。如果您正苦于以下问题:Python Singleton.getMoviesFromSection方法的具体用法?Python Singleton.getMoviesFromSection怎么用?Python Singleton.getMoviesFromSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DPH_Singleton.Singleton的用法示例。


在下文中一共展示了Singleton.getMoviesFromSection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: RemoteHandler

# 需要导入模块: from DPH_Singleton import Singleton [as 别名]
# 或者: from DPH_Singleton.Singleton import getMoviesFromSection [as 别名]

#.........这里部分代码省略.........
				self.send_response(200)

			elif request_path == "player/playback/playMedia":

				url = "http://localhost/web/powerstate?newstate=4"
				urllib.urlopen(url)

				params = self.getParams()

				address = params["address"][0]
				port = params["port"][0]
				completeAddress = address+":"+port
				protocol = params["protocol"][0]
				key = params["key"][0]

				if "offset" in params:
					offset = int(params["offset"][0])
				else:
					offset = 0

				machineIdentifier = params["machineIdentifier"][0]
				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, completeAddress, machineIdentifier))

						listViewList, mediaContainer = self.plexInstance.getMoviesFromSection(protocol + "://" + address + ":" + port + key)

						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"

						data = {"listViewList": listViewList, "mediaContainer": mediaContainer, "autoPlayMode": autoPlayMode, "forceResume":  forceResume, "resumeMode": resumeMode, "playbackMode": playbackMode, "currentIndex": currentIndex, "libraryName": libraryName}

						self.playerCallback(data)

						xml = "<MediaContainer location='navigation' commandID='10'><Timeline state='stopped' time='0' type='music' /><Timeline state='stopped' time='0' type='video' /><Timeline state='stopped' time='0' type='photo' /></MediaContainer>"
						self.setXmlHeader(xml)
						self.end_headers()
						self.wfile.write(xml)

					else:
						printl("no match ...", self, "D")

			else:
				self.send_response(200)
		except:
				traceback.print_exc()
				self.wfile.close()
开发者ID:olive069,项目名称:DreamPlex,代码行数:69,代码来源:DPH_RemoteHandler.py


注:本文中的DPH_Singleton.Singleton.getMoviesFromSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。