From a24cf527988c811c7eceaf8b89eeb438ea8e8e23 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Mon, 13 May 2019 10:31:12 +0200 Subject: [PATCH] Fix for videolibrary function --- channels/support.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/channels/support.py b/channels/support.py index dbe48919..d4aea730 100644 --- a/channels/support.py +++ b/channels/support.py @@ -438,7 +438,7 @@ def match(item, patron='', patron_block='', headers='', url=''): def videolibrary(itemlist, item, typography=''): - if item.contentType != 'episode': + if item.contentType == 'movie': action = 'add_pelicula_to_library' extra = 'findvideos' contentType = 'movie' @@ -448,17 +448,18 @@ def videolibrary(itemlist, item, typography=''): contentType = 'tvshow' title = typo(config.get_localized_string(30161) + ' ' + typography) - if config.get_videolibrary_support() and len(itemlist) > 0: - itemlist.append( - Item(channel=item.channel, - title=title, - contentType=contentType, - contentSerieName=item.fulltitle if contentType == 'tvshow' else '', - url=item.url, - action=action, - extra=extra, - contentTitle=item.fulltitle)) - + if inspect.stack()[1][3] == 'findvideos' and contentType == 'movie' or inspect.stack()[1][3] != 'findvideos' and contentType != 'movie': + if config.get_videolibrary_support() and len(itemlist) > 0: + itemlist.append( + Item(channel=item.channel, + title=title, + contentType=contentType, + contentSerieName=item.fulltitle if contentType == 'tvshow' else '', + url=item.url, + action=action, + extra=extra, + contentTitle=item.fulltitle)) + return itemlist def nextPage(itemlist, item, data, patron, function_level=1): # Function_level is useful if the function is called by another function.