From 3c36af932a6f626b4f10c80e62c01bd887b63dd4 Mon Sep 17 00:00:00 2001 From: marcelveldt Date: Fri, 4 Mar 2016 14:03:15 +0100 Subject: [PATCH] fix extrafanart for homescreen widgets --- default.py | 4 +++- resources/lib/entrypoint.py | 19 +++++-------------- resources/lib/musicutils.py | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/default.py b/default.py index eeb99c00..24e845cc 100644 --- a/default.py +++ b/default.py @@ -67,7 +67,9 @@ class Main: } 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): # Simple functions diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 652d089f..5fe9ea67 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -951,27 +951,18 @@ def getRecentEpisodes(tagname, limit): xbmcplugin.endOfDirectory(handle=int(sys.argv[1])) ##### GET EXTRAFANART FOR LISTITEM ##### -def getExtraFanArt(): +def getExtraFanArt(embyId,embyPath): emby = embyserver.Read_EmbyServer() art = artwork.Artwork() - embyId = "" # Get extrafanart for listitem # will be called by skinhelper script to get the extrafanart try: # for tvshows we get the embyid just from the path - if xbmc.getCondVisibility("Container.Content(tvshows) | Container.Content(seasons) | Container.Content(episodes)"): - itemPath = xbmc.getInfoLabel("ListItem.Path").decode('utf-8') - if "plugin.video.emby" in itemPath: - 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 not embyId: + if "plugin.video.emby" in embyPath: + embyId = embyPath.split("/")[-2] if embyId: #only proceed if we actually have a emby id @@ -1015,7 +1006,7 @@ def getExtraFanArt(): url=fanartFile, listitem=li) 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 xbmcplugin.endOfDirectory(int(sys.argv[1])) \ No newline at end of file diff --git a/resources/lib/musicutils.py b/resources/lib/musicutils.py index 92fbaf66..c58cb245 100644 --- a/resources/lib/musicutils.py +++ b/resources/lib/musicutils.py @@ -214,7 +214,7 @@ def getSongTags(file): except Exception as e: #file in use ? - logMsg("Exception in getSongTags %s" %e,0) + utils.logMsg("Exception in getSongTags", str(e),0) rating = None #remove tempfile if needed....