fix extrafanart for homescreen widgets
This commit is contained in:
parent
7f9b0b879c
commit
3c36af932a
3 changed files with 9 additions and 16 deletions
|
@ -67,7 +67,9 @@ class Main:
|
||||||
}
|
}
|
||||||
|
|
||||||
if "extrafanart" in sys.argv[0]:
|
if "extrafanart" in sys.argv[0]:
|
||||||
entrypoint.getExtraFanArt()
|
embypath = sys.argv[2][1:]
|
||||||
|
embyid = params.get('id',[""])[0]
|
||||||
|
entrypoint.getExtraFanArt(embyid,embypath)
|
||||||
|
|
||||||
if modes.get(mode):
|
if modes.get(mode):
|
||||||
# Simple functions
|
# Simple functions
|
||||||
|
|
|
@ -951,27 +951,18 @@ def getRecentEpisodes(tagname, limit):
|
||||||
xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))
|
xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))
|
||||||
|
|
||||||
##### GET EXTRAFANART FOR LISTITEM #####
|
##### GET EXTRAFANART FOR LISTITEM #####
|
||||||
def getExtraFanArt():
|
def getExtraFanArt(embyId,embyPath):
|
||||||
|
|
||||||
emby = embyserver.Read_EmbyServer()
|
emby = embyserver.Read_EmbyServer()
|
||||||
art = artwork.Artwork()
|
art = artwork.Artwork()
|
||||||
embyId = ""
|
|
||||||
|
|
||||||
# Get extrafanart for listitem
|
# Get extrafanart for listitem
|
||||||
# will be called by skinhelper script to get the extrafanart
|
# will be called by skinhelper script to get the extrafanart
|
||||||
try:
|
try:
|
||||||
# for tvshows we get the embyid just from the path
|
# for tvshows we get the embyid just from the path
|
||||||
if xbmc.getCondVisibility("Container.Content(tvshows) | Container.Content(seasons) | Container.Content(episodes)"):
|
if not embyId:
|
||||||
itemPath = xbmc.getInfoLabel("ListItem.Path").decode('utf-8')
|
if "plugin.video.emby" in embyPath:
|
||||||
if "plugin.video.emby" in itemPath:
|
embyId = embyPath.split("/")[-2]
|
||||||
embyId = itemPath.split("/")[-2]
|
|
||||||
else:
|
|
||||||
#for movies we grab the emby id from the params
|
|
||||||
itemPath = xbmc.getInfoLabel("ListItem.FileNameAndPath").decode('utf-8')
|
|
||||||
if "plugin.video.emby" in itemPath:
|
|
||||||
params = urlparse.parse_qs(itemPath)
|
|
||||||
embyId = params.get('id')
|
|
||||||
if embyId: embyId = embyId[0]
|
|
||||||
|
|
||||||
if embyId:
|
if embyId:
|
||||||
#only proceed if we actually have a emby id
|
#only proceed if we actually have a emby id
|
||||||
|
@ -1015,7 +1006,7 @@ def getExtraFanArt():
|
||||||
url=fanartFile,
|
url=fanartFile,
|
||||||
listitem=li)
|
listitem=li)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
utils.logMsg("EMBY", "Error getting extrafanart: %s" % e, 1)
|
utils.logMsg("EMBY", "Error getting extrafanart: %s" % e, 0)
|
||||||
|
|
||||||
# Always do endofdirectory to prevent errors in the logs
|
# Always do endofdirectory to prevent errors in the logs
|
||||||
xbmcplugin.endOfDirectory(int(sys.argv[1]))
|
xbmcplugin.endOfDirectory(int(sys.argv[1]))
|
|
@ -214,7 +214,7 @@ def getSongTags(file):
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
#file in use ?
|
#file in use ?
|
||||||
logMsg("Exception in getSongTags %s" %e,0)
|
utils.logMsg("Exception in getSongTags", str(e),0)
|
||||||
rating = None
|
rating = None
|
||||||
|
|
||||||
#remove tempfile if needed....
|
#remove tempfile if needed....
|
||||||
|
|
Loading…
Reference in a new issue