Merge remote-tracking branch 'MediaBrowser/master' into develop

This commit is contained in:
tomkat83 2016-01-07 20:32:48 +01:00
commit 194467091a
4 changed files with 26 additions and 22 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.plexkodiconnect" <addon id="plugin.video.plexkodiconnect"
name="PlexKodiConnect" name="PlexKodiConnect"
version="1.1.70" version="1.1.71"
provider-name="tomkat83"> provider-name="tomkat83">
<requires> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>

View file

@ -37,7 +37,6 @@ class Main:
addon_handle = int(sys.argv[1]) addon_handle = int(sys.argv[1])
params = urlparse.parse_qs(sys.argv[2][1:]) params = urlparse.parse_qs(sys.argv[2][1:])
xbmc.log("Parameter string: %s" % sys.argv[2]) xbmc.log("Parameter string: %s" % sys.argv[2])
try: try:
mode = params['mode'][0] mode = params['mode'][0]
itemid = params.get('id') itemid = params.get('id')
@ -52,6 +51,7 @@ class Main:
'reset': utils.reset, 'reset': utils.reset,
'resetauth': entrypoint.resetAuth, 'resetauth': entrypoint.resetAuth,
'extrafanart': entrypoint.getExtraFanArt,
'play': entrypoint.doPlayback, 'play': entrypoint.doPlayback,
'passwords': utils.passwordsXML, 'passwords': utils.passwordsXML,
'adduser': entrypoint.addUser, 'adduser': entrypoint.addUser,
@ -63,6 +63,9 @@ class Main:
'recentepisodes': entrypoint.getRecentEpisodes, 'recentepisodes': entrypoint.getRecentEpisodes,
'refreshplaylist': entrypoint.refreshPlaylist 'refreshplaylist': entrypoint.refreshPlaylist
} }
if "extrafanart" in sys.argv[0]:
entrypoint.getExtraFanArt()
if modes.get(mode): if modes.get(mode):
# Simple functions # Simple functions
@ -101,8 +104,6 @@ class Main:
elif mode == "texturecache": elif mode == "texturecache":
import artwork import artwork
artwork.Artwork().FullTextureCacheSync() artwork.Artwork().FullTextureCacheSync()
elif "extrafanart" in sys.argv[0]:
entrypoint.getExtraFanArt()
else: else:
entrypoint.doMainListing() entrypoint.doMainListing()

View file

@ -820,24 +820,27 @@ def getExtraFanArt():
emby = embyserver.Read_EmbyServer() emby = embyserver.Read_EmbyServer()
art = artwork.Artwork() art = artwork.Artwork()
embyId = ""
# Get extrafanart for listitem # Get extrafanart for listitem
# this will only be used for skins that actually call the listitem's path + fanart dir... # will be called by skinhelper script to get the extrafanart
try: try:
# Only do this if the listitem has actually changed # for tvshows we get the embyid just from the path
itemPath = xbmc.getInfoLabel("ListItem.FileNameAndPath") if xbmc.getCondVisibility("Container.Content(tvshows) | Container.Content(seasons) | Container.Content(episodes)"):
if not itemPath:
itemPath = xbmc.getInfoLabel("ListItem.Path") itemPath = xbmc.getInfoLabel("ListItem.Path")
if "plugin.video.emby" in itemPath:
if any([x in itemPath for x in ['tvshows', 'musicvideos', 'movies']]):
params = urlparse.parse_qs(itemPath)
try:
embyId = params['id'][0]
except KeyError:
embyId = itemPath.split("/")[-2] embyId = itemPath.split("/")[-2]
else:
utils.logMsg("EMBY", "Requesting extrafanart for Id: %s" % embyId, 1) #for movies we grab the emby id from the params
itemPath = xbmc.getInfoLabel("ListItem.FileNameAndPath")
if "plugin.video.emby" in itemPath:
params = urlparse.parse_qs(itemPath)
embyId = params.get('id')
if embyId: embyId = embyId[0]
if embyId:
#only proceed if we actually have a emby id
utils.logMsg("EMBY", "Requesting extrafanart for Id: %s" % embyId, 0)
# We need to store the images locally for this to work # We need to store the images locally for this to work
# because of the caching system in xbmc # because of the caching system in xbmc

View file

@ -116,7 +116,7 @@ class VideoNodes(object):
'4': "inprogress", '4': "inprogress",
'5': "inprogressepisodes", '5': "inprogressepisodes",
'6': "unwatched", '6': "unwatched",
'7': "nextupepisodes", '7': "nextepisodes",
'8': "sets", '8': "sets",
'9': "genres", '9': "genres",
'10': "random", '10': "random",
@ -161,7 +161,7 @@ class VideoNodes(object):
label = stringid label = stringid
# Set window properties # Set window properties
if nodetype == "nextupepisodes": if nodetype == "nextepisodes":
# Custom query # Custom query
path = "plugin://plugin.video.plexkodiconnect/?id=%s&mode=nextup&limit=25" % tagname path = "plugin://plugin.video.plexkodiconnect/?id=%s&mode=nextup&limit=25" % tagname
elif kodiversion == 14 and nodetype == "recentepisodes": elif kodiversion == 14 and nodetype == "recentepisodes":
@ -172,7 +172,7 @@ class VideoNodes(object):
path = "plugin://plugin.video.plexkodiconnect/?id=%s&mode=inprogressepisodes&limit=25"% tagname path = "plugin://plugin.video.plexkodiconnect/?id=%s&mode=inprogressepisodes&limit=25"% tagname
else: else:
path = "library://video/Emby - %s/%s_%s.xml" % (dirname, cleantagname, nodetype) path = "library://video/Emby - %s/%s_%s.xml" % (dirname, cleantagname, nodetype)
windowpath = "ActivateWindow(Video, %s, return)" % path windowpath = "ActivateWindow(Video,%s,return)" % path
if nodetype == "all": if nodetype == "all":
@ -198,7 +198,7 @@ class VideoNodes(object):
# Create the root # Create the root
if nodetype == "nextupepisodes" or (kodiversion == 14 and if nodetype == "nextepisodes" or (kodiversion == 14 and
nodetype in ('recentepisodes', 'inprogressepisodes')): nodetype in ('recentepisodes', 'inprogressepisodes')):
# Folder type with plugin path # Folder type with plugin path
root = self.commonRoot(order=node, label=label, tagname=tagname, roottype=2) root = self.commonRoot(order=node, label=label, tagname=tagname, roottype=2)
@ -277,7 +277,7 @@ class VideoNodes(object):
nodepath = xbmc.translatePath("special://profile/library/video/").decode('utf-8') nodepath = xbmc.translatePath("special://profile/library/video/").decode('utf-8')
nodeXML = "%semby_%s.xml" % (nodepath, cleantagname) nodeXML = "%semby_%s.xml" % (nodepath, cleantagname)
path = "library://video/emby_%s.xml" % (cleantagname) path = "library://video/emby_%s.xml" % (cleantagname)
windowpath = "ActivateWindow(Video, %s, return)" % path windowpath = "ActivateWindow(Video,%s,return)" % path
# Create the video node directory # Create the video node directory
if not xbmcvfs.exists(nodepath): if not xbmcvfs.exists(nodepath):