Community Channels:
Fix Aggiungi alla videoteca e Download
This commit is contained in:
@@ -988,6 +988,7 @@ def match_dbg(data, patron):
|
||||
|
||||
def download(itemlist, item, typography='', function_level=1, function=''):
|
||||
if config.get_setting('downloadenabled'):
|
||||
|
||||
if not typography: typography = 'color kod bold'
|
||||
|
||||
if item.contentType == 'movie':
|
||||
@@ -996,9 +997,14 @@ def download(itemlist, item, typography='', function_level=1, function=''):
|
||||
elif item.contentType == 'episode':
|
||||
from_action = 'findvideos'
|
||||
title = typo(config.get_localized_string(60356), typography) + ' - ' + item.title
|
||||
elif item.contentType == 'tvshow':
|
||||
from_action = 'episodios'
|
||||
elif item.contentType in 'tvshow':
|
||||
if item.channel == 'community' and config.get_setting('show_seasons', item.channel):
|
||||
from_action = 'season'
|
||||
else:
|
||||
from_action = 'episodios'
|
||||
title = typo(config.get_localized_string(60355), typography)
|
||||
elif item.contentType in 'season':
|
||||
from_action = 'get_seasons'
|
||||
else: # content type does not support download
|
||||
return itemlist
|
||||
|
||||
@@ -1017,7 +1023,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
|
||||
break
|
||||
else:
|
||||
show = False
|
||||
if show:
|
||||
if show and item.contentType != 'season':
|
||||
itemlist.append(
|
||||
Item(channel='downloads',
|
||||
from_channel=item.channel,
|
||||
|
||||
@@ -255,7 +255,7 @@ def get_seasons(item):
|
||||
action='episodios',
|
||||
contentSeason=option['season'],
|
||||
infoLabels=infoLabels,
|
||||
contentType='season',
|
||||
contentType='season' if show_seasons else 'tvshow',
|
||||
path=extra.path))
|
||||
|
||||
if inspect.stack()[2][3] in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest'] or show_seasons == False:
|
||||
@@ -265,6 +265,10 @@ def get_seasons(item):
|
||||
itemlist = itlist
|
||||
if inspect.stack()[2][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'get_newest'] and defp and not item.disable_pagination:
|
||||
itemlist = pagination(item, itemlist)
|
||||
|
||||
if show_seasons:
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -353,16 +357,17 @@ def episodios(item, json ='', key='', itemlist =[]):
|
||||
itemlist = []
|
||||
for season in season_list:
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=set_title(config.get_localized_string(60027) % season),
|
||||
fulltitle=itm.fulltitle,
|
||||
show=itm.show,
|
||||
thumbnails=itm.thumbnails,
|
||||
url=itm.url,
|
||||
action='episodios',
|
||||
contentSeason=season,
|
||||
infoLabels=infoLabels,
|
||||
filterseason=str(season),
|
||||
path=item.path))
|
||||
title=set_title(config.get_localized_string(60027) % season),
|
||||
fulltitle=itm.fulltitle,
|
||||
show=itm.show,
|
||||
thumbnails=itm.thumbnails,
|
||||
url=itm.url,
|
||||
action='episodios',
|
||||
contentSeason=season,
|
||||
contentType = 'episode',
|
||||
infoLabels=infoLabels,
|
||||
filterseason=str(season),
|
||||
path=item.path))
|
||||
|
||||
elif defp and inspect.stack()[1][3] not in ['get_seasons'] and not item.disable_pagination:
|
||||
if Pagination and len(itemlist) >= Pagination:
|
||||
@@ -371,6 +376,9 @@ def episodios(item, json ='', key='', itemlist =[]):
|
||||
item.page = pag + 1
|
||||
item.thumbnail = support.thumb()
|
||||
itemlist.append(item)
|
||||
if not show_seasons:
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
return itemlist
|
||||
|
||||
|
||||
|
||||
@@ -840,7 +840,7 @@ def start_download(item):
|
||||
|
||||
def get_episodes(item):
|
||||
log("contentAction: %s | contentChannel: %s | contentType: %s" % (item.contentAction, item.contentChannel, item.contentType))
|
||||
|
||||
|
||||
if 'dlseason' in item:
|
||||
season = True
|
||||
season_number = item.dlseason
|
||||
@@ -864,8 +864,9 @@ def get_episodes(item):
|
||||
episodes = getattr(channel, item.contentAction)(item)
|
||||
|
||||
itemlist = []
|
||||
if episodes and not scrapertools.find_single_match(episodes[0].title, r'(\d+.\d+)') and item.channel not in ['videolibrary']:
|
||||
if episodes and not scrapertools.find_single_match(episodes[0].title, r'(\d+.\d+)') and item.channel not in ['videolibrary'] and item.action != 'season':
|
||||
from specials.autorenumber import select_type, renumber, check
|
||||
# support.dbg()
|
||||
if not check(item):
|
||||
select_type(item)
|
||||
return get_episodes(item)
|
||||
|
||||
Reference in New Issue
Block a user