Reduce boilerplate

This commit is contained in:
tomkat83 2016-07-22 16:55:57 +02:00
parent bc7be04fc2
commit 3407d47f9c

View file

@ -1299,6 +1299,7 @@ def getVideoFiles(plexId, params):
xbmcplugin.endOfDirectory(int(sys.argv[1])) xbmcplugin.endOfDirectory(int(sys.argv[1]))
@utils.CatchExceptions(warnuser=False)
def getExtraFanArt(plexid, plexPath): def getExtraFanArt(plexid, plexPath):
""" """
Get extrafanart for listitem Get extrafanart for listitem
@ -1314,7 +1315,6 @@ def getExtraFanArt(plexid, plexPath):
utils.logMsg(title, 'Could not get a plexid, aborting', -1) utils.logMsg(title, 'Could not get a plexid, aborting', -1)
return xbmcplugin.endOfDirectory(int(sys.argv[1])) return xbmcplugin.endOfDirectory(int(sys.argv[1]))
try:
# 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
fanartDir = utils.tryDecode(xbmc.translatePath( fanartDir = utils.tryDecode(xbmc.translatePath(
@ -1354,11 +1354,6 @@ def getExtraFanArt(plexid, plexPath):
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
url=fanartFile, url=fanartFile,
listitem=li) listitem=li)
except Exception as e:
utils.logMsg(title, "Error getting extrafanart: %s" % e, -1)
import traceback
utils.logMsg("Traceback:\n%s" % traceback.format_exc(), 0)
xbmcplugin.endOfDirectory(int(sys.argv[1])) xbmcplugin.endOfDirectory(int(sys.argv[1]))