migliorie download

This commit is contained in:
marco
2020-04-19 18:30:13 +02:00
parent 2502ac48b2
commit 3708a25d0c
3 changed files with 40 additions and 38 deletions

View File

@@ -1107,10 +1107,8 @@ def get_dialogo_opciones(item, default_action, strm, autoplay):
opciones.append(config.get_localized_string(30164))
else:
# "Descargar"
import xbmcaddon
addon = xbmcaddon.Addon('plugin.video.kod')
downloadenabled = addon.getSetting('downloadenabled')
if downloadenabled != "false":
downloadenabled = config.get_setting('downloadenabled')
if downloadenabled != "false" and item.channel != 'videolibrary':
opcion = config.get_localized_string(30153)
opciones.append(opcion)

View File

@@ -946,7 +946,10 @@ def save_download_background(item):
if item.channel == 'videolibrary':
from specials import videolibrary
parent = Item().fromurl(item.parent)
if not item.parent:
parent = item
else:
parent = Item().fromurl(item.parent)
parent.contentChannel = 'videolibrary'
if item.downloadItemlist: # episode
parent.downloadItemlist = item.downloadItemlist

View File

@@ -1168,37 +1168,38 @@ def check_tvshow_playcount(item, season):
def add_download_items(item, itemlist):
localOnly = True
for i in itemlist:
if i.contentChannel != 'local':
localOnly = False
break
if not item.fromLibrary and not localOnly:
downloadItem = Item(channel='downloads',
from_channel=item.channel,
title=typo(config.get_localized_string(60355), "color kod bold"),
fulltitle=item.fulltitle,
show=item.fulltitle,
contentType=item.contentType,
contentSerieName=item.contentSerieName,
url=item.url,
action='save_download',
from_action="findvideos",
contentTitle=item.contentTitle,
path=item.path,
thumbnail=thumb(thumb='downloads.png'),
parent=item.tourl())
if item.action == 'findvideos':
if item.contentType == 'episode':
downloadItem.title = typo(config.get_localized_string(60356), "color kod bold")
else: # film
downloadItem.title = typo(config.get_localized_string(60354), "color kod bold")
downloadItem.downloadItemlist = [i.tourl() for i in itemlist]
itemlist.append(downloadItem)
else:
if item.contentSeason: # season
downloadItem.title = typo(config.get_localized_string(60357), "color kod bold")
if config.get_setting('downloadenabled'):
localOnly = True
for i in itemlist:
if i.contentChannel != 'local':
localOnly = False
break
if not item.fromLibrary and not localOnly:
downloadItem = Item(channel='downloads',
from_channel=item.channel,
title=typo(config.get_localized_string(60355), "color kod bold"),
fulltitle=item.fulltitle,
show=item.fulltitle,
contentType=item.contentType,
contentSerieName=item.contentSerieName,
url=item.url,
action='save_download',
from_action="findvideos",
contentTitle=item.contentTitle,
path=item.path,
thumbnail=thumb(thumb='downloads.png'),
parent=item.tourl())
if item.action == 'findvideos':
if item.contentType == 'episode':
downloadItem.title = typo(config.get_localized_string(60356), "color kod bold")
else: # film
downloadItem.title = typo(config.get_localized_string(60354), "color kod bold")
downloadItem.downloadItemlist = [i.tourl() for i in itemlist]
itemlist.append(downloadItem)
else: # tvshow + not seen
itemlist.append(downloadItem)
itemlist.append(downloadItem.clone(title=typo(config.get_localized_string(60003), "color kod bold"), unseen=True))
else:
if item.contentSeason: # season
downloadItem.title = typo(config.get_localized_string(60357), "color kod bold")
itemlist.append(downloadItem)
else: # tvshow + not seen
itemlist.append(downloadItem)
itemlist.append(downloadItem.clone(title=typo(config.get_localized_string(60003), "color kod bold"), unseen=True))