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