mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
fixed autoplay episodes
This commit is contained in:
parent
08ea50bdca
commit
8de2eecdcf
1 changed files with 8 additions and 5 deletions
|
@ -139,6 +139,10 @@ class Player( xbmc.Player ):
|
||||||
self.logMsg("reportPlayback Called", 2)
|
self.logMsg("reportPlayback Called", 2)
|
||||||
xbmcplayer = self.xbmcplayer
|
xbmcplayer = self.xbmcplayer
|
||||||
|
|
||||||
|
if not xbmcplayer.isPlaying():
|
||||||
|
self.logMsg("reportPlayback: Not playing anything so returning", 0)
|
||||||
|
return
|
||||||
|
|
||||||
currentFile = xbmcplayer.getPlayingFile()
|
currentFile = xbmcplayer.getPlayingFile()
|
||||||
data = self.played_information.get(currentFile)
|
data = self.played_information.get(currentFile)
|
||||||
|
|
||||||
|
@ -325,14 +329,11 @@ class Player( xbmc.Player ):
|
||||||
def autoPlayPlayback(self):
|
def autoPlayPlayback(self):
|
||||||
currentFile = xbmc.Player().getPlayingFile()
|
currentFile = xbmc.Player().getPlayingFile()
|
||||||
data = self.played_information.get(currentFile)
|
data = self.played_information.get(currentFile)
|
||||||
|
|
||||||
# only report playback if emby has initiated the playback (item_id has value)
|
# only report playback if emby has initiated the playback (item_id has value)
|
||||||
if(data != None and data.get("item_id") != None):
|
if(data != None and data.get("item_id") != None):
|
||||||
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
|
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
|
||||||
|
|
||||||
item_id = data.get("item_id")
|
item_id = data.get("item_id")
|
||||||
type = data.get("Type")
|
type = data.get("Type")
|
||||||
|
|
||||||
# if its an episode see if autoplay is enabled
|
# if its an episode see if autoplay is enabled
|
||||||
if addonSettings.getSetting("autoPlaySeason")=="true" and type=="Episode":
|
if addonSettings.getSetting("autoPlaySeason")=="true" and type=="Episode":
|
||||||
WINDOW = xbmcgui.Window( 10000 )
|
WINDOW = xbmcgui.Window( 10000 )
|
||||||
|
@ -347,8 +348,10 @@ class Player( xbmc.Player ):
|
||||||
seasonId = MB3Episode["SeasonId"]
|
seasonId = MB3Episode["SeasonId"]
|
||||||
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&ImageTypeLimit=1&Limit=1&SortBy=SortName&SortOrder=Ascending&Filters=IsUnPlayed&IncludeItemTypes=Episode&IsVirtualUnaired=false&Recursive=true&IsMissing=False&format=json" % seasonId
|
url = "{server}/mediabrowser/Users/{UserId}/Items?ParentId=%s&ImageTypeLimit=1&Limit=1&SortBy=SortName&SortOrder=Ascending&Filters=IsUnPlayed&IncludeItemTypes=Episode&IsVirtualUnaired=false&Recursive=true&IsMissing=False&format=json" % seasonId
|
||||||
jsonData = self.doUtils.downloadUrl(url)
|
jsonData = self.doUtils.downloadUrl(url)
|
||||||
|
|
||||||
if(jsonData != ""):
|
if(jsonData != ""):
|
||||||
seasonData = json.loads(jsonData)
|
seasonData = jsonData
|
||||||
|
|
||||||
if seasonData.get("Items") != None:
|
if seasonData.get("Items") != None:
|
||||||
item = seasonData.get("Items")[0]
|
item = seasonData.get("Items")[0]
|
||||||
pDialog.create("Auto Play next episode", str(item.get("ParentIndexNumber")) + "x" + str(item.get("IndexNumber")) + ". " + item["Name"] + " found","Cancel to stop automatic play")
|
pDialog.create("Auto Play next episode", str(item.get("ParentIndexNumber")) + "x" + str(item.get("IndexNumber")) + ". " + item["Name"] + " found","Cancel to stop automatic play")
|
||||||
|
|
Loading…
Reference in a new issue