Migliorie varie download e videolibrary_service rinominato in service
This commit is contained in:
@@ -34,6 +34,6 @@
|
||||
<forum>https://t.me/kodiondemand</forum>
|
||||
<source>https://github.com/kodiondemand/addon</source>
|
||||
</extension>
|
||||
<extension point="xbmc.service" library="videolibrary_service.py" start="login|startup">
|
||||
<extension point="xbmc.service" library="service.py" start="login|startup">
|
||||
</extension>
|
||||
</addon>
|
||||
|
||||
@@ -910,7 +910,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
|
||||
|
||||
contentSerieName=item.contentSerieName if item.contentSerieName else ''
|
||||
contentTitle=item.contentTitle if item.contentTitle else ''
|
||||
serverItemlist = [i.tourl() for i in itemlist]
|
||||
downloadItemlist = [i.tourl() for i in itemlist]
|
||||
|
||||
if itemlist and item.contentChannel != 'videolibrary':
|
||||
itemlist.append(
|
||||
@@ -927,7 +927,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
|
||||
contentTitle=contentTitle,
|
||||
path=item.path,
|
||||
thumbnail=thumb(thumb='downloads.png'),
|
||||
serverItemlist=serverItemlist
|
||||
downloadItemlist=downloadItemlist
|
||||
))
|
||||
if from_action == 'episodios':
|
||||
itemlist.append(
|
||||
@@ -944,7 +944,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
|
||||
contentTitle=contentTitle,
|
||||
download='season',
|
||||
thumbnail=thumb(thumb='downloads.png'),
|
||||
serverItemlist=serverItemlist
|
||||
downloadItemlist=downloadItemlist
|
||||
))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -537,7 +537,7 @@ def save_tvshow(item, episodelist):
|
||||
item_tvshow.library_filter_show = {item.channel: item.show}
|
||||
|
||||
if item.channel != "downloads":
|
||||
item_tvshow.active = 1 # para que se actualice a diario cuando se llame a videolibrary_service
|
||||
item_tvshow.active = 1 # para que se actualice a diario cuando se llame a service
|
||||
|
||||
filetools.write(tvshow_path, head_nfo + item_tvshow.tojson())
|
||||
|
||||
@@ -601,7 +601,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
nostrm_episodelist.append(season_episode)
|
||||
nostrm_episodelist = sorted(set(nostrm_episodelist))
|
||||
|
||||
# Silent es para no mostrar progreso (para videolibrary_service)
|
||||
# Silent es para no mostrar progreso (para service)
|
||||
if not silent:
|
||||
# progress dialog
|
||||
p_dialog = platformtools.dialog_progress(config.get_localized_string(20000), config.get_localized_string(60064))
|
||||
|
||||
@@ -1822,11 +1822,11 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
|
||||
# - patron5: expresión Regex aplicable a la url (opcional)
|
||||
# - content_inc: contenido al que aplica esta entrada, o * (item.contentType o item.extra)
|
||||
# - content_exc: contenido que se excluye de esta entrada (item.contentType) (opcional). opción para 'emerg'
|
||||
# - ow_force: indicador para la acción de "videolibrary_service.py". Puede crear la variable item.ow_force:
|
||||
# - force: indica al canal que analize toda la serie y que videolibrary_service la reescriba
|
||||
# - auto: indica a videolibrary_service que la reescriba
|
||||
# - no: no acción para videolibrary_service, solo redirige en visionado de videolibrary
|
||||
# - del: borra las estrucuturas de un determinado canal en videolibrary_service, quizás creadas por errores de un canal
|
||||
# - ow_force: indicador para la acción de "service.py". Puede crear la variable item.ow_force:
|
||||
# - force: indica al canal que analize toda la serie y que service la reescriba
|
||||
# - auto: indica a service que la reescriba
|
||||
# - no: no acción para service, solo redirige en visionado de videolibrary
|
||||
# - del: borra las estrucuturas de un determinado canal en service, quizás creadas por errores de un canal
|
||||
# - emerg: funcionalidad muy similar a la de "del". se general dinámicamente cada vez que entra un canal con el estado activado en el .json de "emergency_urls". Permite cargar las urls de emergencia en todos los elementos existentes de la Videoteca para canal afectado
|
||||
# ejemplos:
|
||||
# ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)([^0-9]+-)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-\\d+-(Temporada-).html', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-(\\d+)-', '', 'tvshow, season', '', 'force'),
|
||||
@@ -1835,7 +1835,7 @@ def redirect_clone_newpct1(item, head_nfo=None, it=None, path=False, overwrite=F
|
||||
# ('1', 'newpct1', '', '', '', '', '', '', '', '', '*', '', 'del'),
|
||||
# ('1', 'torrentrapid', 'torrentrapid', '', '', '', '', '', '', '', '*', '1 ó 2', 'emerg'),
|
||||
#
|
||||
# La llamada recibe el parámetro Item, el .nfo y los devuleve actualizados, así como opcionalmente el parámetro "overwrite· que puede forzar la reescritura de todos los archivos de la serie, y el parámetro "path" si viene de videolibrary_service. Por último, recibe opcionalmente el parámetro "lookup" si se quiere solo averigurar si habrá migración para ese título, pero sin realizarla.
|
||||
# La llamada recibe el parámetro Item, el .nfo y los devuleve actualizados, así como opcionalmente el parámetro "overwrite· que puede forzar la reescritura de todos los archivos de la serie, y el parámetro "path" si viene de service. Por último, recibe opcionalmente el parámetro "lookup" si se quiere solo averigurar si habrá migración para ese título, pero sin realizarla.
|
||||
#
|
||||
# """
|
||||
# #logger.debug(item)
|
||||
|
||||
@@ -37,7 +37,7 @@ def init():
|
||||
|
||||
Los pasos que sigue esta función, son los siguientes:
|
||||
|
||||
1.- La función se llama desde videolibrary_service.py, desde la función inicial:
|
||||
1.- La función se llama desde service.py, desde la función inicial:
|
||||
# Copia Custom code a las carpetas de Alfa desde la zona de Userdata
|
||||
from platformcode import custom_code
|
||||
custom_code.init()
|
||||
|
||||
@@ -1077,14 +1077,7 @@ def set_opcion(item, seleccion, opciones, video_urls):
|
||||
# "Descargar"
|
||||
elif opciones[seleccion] == config.get_localized_string(30153):
|
||||
from specials import downloads
|
||||
import xbmcaddon
|
||||
import xbmcgui
|
||||
__addon__ = xbmcaddon.Addon()
|
||||
__addonname__ = __addon__.getAddonInfo('name')
|
||||
line1 = config.get_localized_string(70690)
|
||||
line2 = config.get_localized_string(70691)
|
||||
line3 = config.get_localized_string(70692)
|
||||
xbmcgui.Dialog().ok(__addonname__, line1, line2, line3)
|
||||
downloads.show_disclaimer()
|
||||
|
||||
if item.contentType == "list" or item.contentType == "tvshow":
|
||||
item.contentType = "video"
|
||||
|
||||
@@ -49,7 +49,7 @@ def loadCommits(page=1):
|
||||
return ret
|
||||
|
||||
|
||||
# ret -> aggiornato, necessita reload videolibrary_service
|
||||
# ret -> aggiornato, necessita reload service
|
||||
def check(background=False):
|
||||
if not addon.getSetting('addon_update_enabled'):
|
||||
return False, False
|
||||
@@ -109,7 +109,7 @@ def check(background=False):
|
||||
logger.info(file["filename"])
|
||||
if 'resources/language' in file["filename"]:
|
||||
poFilesChanged = True
|
||||
if 'videolibrary_service.py' in file["filename"]:
|
||||
if 'service.py' in file["filename"]:
|
||||
serviceChanged = True
|
||||
if file['status'] == 'modified' or file['status'] == 'added':
|
||||
if 'patch' in file:
|
||||
|
||||
@@ -623,7 +623,7 @@ msgid "No links available that meets the requirements of the Black list. Try aga
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#60003"
|
||||
msgid "Connessione con %s"
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#60004"
|
||||
@@ -631,7 +631,7 @@ msgid "No connector for the server %s"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#60005"
|
||||
msgid "Connecting with %s"
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#60006"
|
||||
@@ -3527,7 +3527,7 @@ msgid "Getting episodes..."
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70187"
|
||||
msgid "connecting with %s..."
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70188"
|
||||
|
||||
@@ -622,16 +622,16 @@ msgid "No links available that meets the requirements of the Black list. Try aga
|
||||
msgstr "Nessun collegamento disponibile che soddisfi i requisiti della Black list. Riprova modificando il filtro in 'Configurazione Server"
|
||||
|
||||
msgctxt "#60003"
|
||||
msgid "Connessione con %s"
|
||||
msgstr "Connessione con %s"
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#60004"
|
||||
msgid "No connector for the server %s"
|
||||
msgstr "Non c'è nessun connettore per il server %s"
|
||||
|
||||
msgctxt "#60005"
|
||||
msgid "Connecting with %s"
|
||||
msgstr "Connessione con %s"
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#60006"
|
||||
msgid "An error has occurred in %s"
|
||||
@@ -3526,8 +3526,8 @@ msgid "Getting episodes..."
|
||||
msgstr "Ottenimento episodi..."
|
||||
|
||||
msgctxt "#70187"
|
||||
msgid "connecting with %s..."
|
||||
msgstr "connessione con %s..."
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70188"
|
||||
msgid "Obtaining data for the TV show"
|
||||
|
||||
@@ -382,6 +382,10 @@ if __name__ == "__main__":
|
||||
import xbmc
|
||||
import time
|
||||
|
||||
# mark as stopped all downloads (if we are here, probably kodi just started)
|
||||
from specials.downloads import stop_all
|
||||
stop_all()
|
||||
|
||||
# modo adulto:
|
||||
# sistema actual 0: Nunca, 1:Siempre, 2:Solo hasta que se reinicie Kodi
|
||||
# si es == 2 lo desactivamos.
|
||||
@@ -90,8 +90,8 @@ def import_videolibrary(item):
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80008))
|
||||
|
||||
if platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(80009)):
|
||||
import videolibrary_service
|
||||
videolibrary_service.check_for_update(overwrite=True)
|
||||
import service
|
||||
service.check_for_update(overwrite=True)
|
||||
|
||||
if config.is_xbmc() and config.get_setting("videolibrary_kodi"):
|
||||
xbmc_videolibrary.update()
|
||||
|
||||
@@ -96,13 +96,6 @@ def mainlist(item):
|
||||
|
||||
estados = [i.downloadStatus for i in itemlist]
|
||||
|
||||
# if there's at least one downloading
|
||||
if 4 in estados:
|
||||
itemlist.insert(0, Item(channel=item.channel, action="stop_all", title= support.typo(config.get_localized_string(60222),'bold'),
|
||||
contentType=item.contentType, contentChannel=item.contentChannel,
|
||||
contentSerieName=item.contentSerieName, thumbnail=get_thumb('stop.png'),
|
||||
text_color=STATUS_COLORS[STATUS_CODES.downloading]))
|
||||
|
||||
# Si hay alguno completado
|
||||
if 2 in estados:
|
||||
itemlist.insert(0, Item(channel=item.channel, action="clean_ready", title=config.get_localized_string(70218),
|
||||
@@ -126,6 +119,13 @@ def mainlist(item):
|
||||
contentType=item.contentType, contentChannel=item.contentChannel, thumbnail=get_thumb('delete.png'),
|
||||
contentSerieName=item.contentSerieName))
|
||||
|
||||
# if there's at least one downloading
|
||||
if 4 in estados:
|
||||
itemlist.insert(0, Item(channel=item.channel, action="stop_all", title=config.get_localized_string(60222),
|
||||
contentType=item.contentType, contentChannel=item.contentChannel,
|
||||
contentSerieName=item.contentSerieName, thumbnail=get_thumb('stop.png'),
|
||||
text_color=STATUS_COLORS[STATUS_CODES.downloading]))
|
||||
|
||||
if not item.contentType == "tvshow" and config.get_setting("browser") == True:
|
||||
itemlist.insert(0, Item(channel=item.channel, action="browser", title=support.typo(config.get_localized_string(70222),'bold'), thumbnail=get_thumb('search.png'), url=DOWNLOAD_PATH))
|
||||
|
||||
@@ -179,7 +179,7 @@ def del_dir(item):
|
||||
|
||||
def clean_all(item):
|
||||
logger.info()
|
||||
stop_all(item)
|
||||
stop_all()
|
||||
|
||||
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
|
||||
if fichero.endswith(".json"):
|
||||
@@ -188,14 +188,14 @@ def clean_all(item):
|
||||
item.contentSerieName == download_item.contentSerieName and item.contentChannel == download_item.contentChannel):
|
||||
filetools.remove(filetools.join(DOWNLOAD_LIST_PATH, fichero))
|
||||
xbmc.sleep(100)
|
||||
platformtools.itemlist_update(item, True)
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def reload(item):
|
||||
platformtools.itemlist_update(item, True)
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def stop_all(item):
|
||||
def stop_all(item=None):
|
||||
logger.info()
|
||||
|
||||
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
|
||||
@@ -204,7 +204,8 @@ def stop_all(item):
|
||||
if download_item.downloadStatus == 4:
|
||||
update_json(filetools.join(DOWNLOAD_LIST_PATH, fichero), {"downloadStatus": STATUS_CODES.stoped})
|
||||
xbmc.sleep(100)
|
||||
platformtools.itemlist_update(item, True)
|
||||
if item:
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def clean_ready(item):
|
||||
@@ -217,7 +218,7 @@ def clean_ready(item):
|
||||
if download_item.downloadStatus == STATUS_CODES.completed:
|
||||
filetools.remove(filetools.join(DOWNLOAD_LIST_PATH, fichero))
|
||||
|
||||
platformtools.itemlist_update(item, True)
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def restart_error(item):
|
||||
@@ -237,14 +238,14 @@ def restart_error(item):
|
||||
update_json(item.path,
|
||||
{"downloadStatus": STATUS_CODES.stoped, "downloadComplete": 0, "downloadProgress": 0})
|
||||
|
||||
platformtools.itemlist_update(item, True)
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def download_all(item):
|
||||
time.sleep(0.5)
|
||||
item.action = "download_all_background"
|
||||
xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?" + item.tourl() + ")")
|
||||
platformtools.itemlist_update(item, True)
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def download_all_background(item):
|
||||
@@ -333,10 +334,10 @@ def menu(item):
|
||||
update_json(item.path, {"downloadStatus": STATUS_CODES.stoped})
|
||||
|
||||
if opciones[seleccion] == op[5]:
|
||||
xbmc.executebuiltin('PlayMedia(' + filetools.join(DOWNLOAD_PATH, item.downloadFilename) + ')')
|
||||
xbmc.executebuiltin('PlayMedia(' + filetools.join(DOWNLOAD_PATH, item.downloadFilename) + ',resume)')
|
||||
|
||||
if opciones[seleccion] != op[5]:
|
||||
platformtools.itemlist_update(item, True)
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def move_to_libray(item):
|
||||
@@ -584,6 +585,12 @@ def download_from_url(url, item):
|
||||
part_size=2 ** (20 + int(config.get_setting("part_size", "downloads"))),
|
||||
max_buffer=2 * int(config.get_setting("max_buffer", "downloads")),
|
||||
json_path=item.path)
|
||||
dir = filetools.dirname(item.downloadFilename)
|
||||
file = filetools.join(dir, d.filename)
|
||||
|
||||
update_json(item.path, {"downloadUrl": d.download_url, "downloadStatus": STATUS_CODES.downloading, "downloadSize": d.size[0],
|
||||
"downloadProgress": d.progress, "downloadCompleted": d.downloaded[0], "downloadFilename": file})
|
||||
|
||||
d.start_dialog(config.get_localized_string(60332))
|
||||
|
||||
# Descarga detenida. Obtenemos el estado:
|
||||
@@ -607,9 +614,6 @@ def download_from_url(url, item):
|
||||
|
||||
save_server_statistics(item.server, d.speed[0], d.state != d.states.error)
|
||||
|
||||
dir = filetools.dirname(item.downloadFilename)
|
||||
file = filetools.join(dir, d.filename)
|
||||
|
||||
if status == STATUS_CODES.completed:
|
||||
move_to_libray(item.clone(downloadFilename=file))
|
||||
|
||||
@@ -622,13 +626,14 @@ def download_from_server(item):
|
||||
unsupported_servers = ["torrent"]
|
||||
|
||||
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70178) % item.server)
|
||||
try:
|
||||
if item.contentChannel == 'community':
|
||||
channel = __import__('specials.%s' % item.contentChannel, None, None, ['specials.%s' % item.contentChannel])
|
||||
else:
|
||||
channel = __import__('channels.%s' % item.contentChannel, None, None, ['channels.%s' % item.contentChannel])
|
||||
if hasattr(channel, "play") and not item.play_menu:
|
||||
|
||||
progreso.update(50, config.get_localized_string(70178) % item.server, config.get_localized_string(60003) % item.contentChannel)
|
||||
progreso.update(50, config.get_localized_string(70178) % item.server, config.get_localized_string(70180) % item.contentChannel)
|
||||
try:
|
||||
itemlist = getattr(channel, "play")(item.clone(channel=item.contentChannel, action=item.contentAction))
|
||||
except:
|
||||
@@ -645,6 +650,7 @@ def download_from_server(item):
|
||||
else:
|
||||
logger.info("There is nothing to reproduce")
|
||||
return {"downloadStatus": STATUS_CODES.error}
|
||||
finally:
|
||||
progreso.close()
|
||||
logger.info("contentAction: %s | contentChannel: %s | server: %s | url: %s" % (
|
||||
item.contentAction, item.contentChannel, item.server, item.url))
|
||||
@@ -691,9 +697,9 @@ def download_from_best_server(item):
|
||||
result = {"downloadStatus": STATUS_CODES.error}
|
||||
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70179))
|
||||
try:
|
||||
if item.serverItemlist:
|
||||
if item.downloadItemlist:
|
||||
logger.info('using cached servers')
|
||||
play_items = [Item().fromurl(i) for i in item.serverItemlist]
|
||||
play_items = [Item().fromurl(i) for i in item.downloadItemlist]
|
||||
else:
|
||||
if item.contentChannel == 'community':
|
||||
channel = __import__('specials.%s' % item.contentChannel, None, None, ['specials.%s' % item.contentChannel])
|
||||
@@ -739,13 +745,15 @@ def download_from_best_server(item):
|
||||
|
||||
|
||||
def select_server(item):
|
||||
if item.server:
|
||||
return "Auto"
|
||||
logger.info(
|
||||
"contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url))
|
||||
|
||||
progreso = platformtools.dialog_progress(config.get_localized_string(30101), config.get_localized_string(70179))
|
||||
if item.serverItemlist:
|
||||
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70179))
|
||||
try:
|
||||
if item.downloadItemlist:
|
||||
logger.info('using cached servers')
|
||||
play_items = [Item().fromurl(i) for i in item.serverItemlist]
|
||||
play_items = [Item().fromurl(i) for i in item.downloadItemlist]
|
||||
else:
|
||||
if item.contentChannel == 'community':
|
||||
channel = __import__('specials.%s' % item.contentChannel, None, None, ['specials.%s' % item.contentChannel])
|
||||
@@ -761,20 +769,22 @@ def select_server(item):
|
||||
|
||||
play_items = [x for x in play_items if x.action == "play" and not "trailer" in x.title.lower()]
|
||||
progreso.update(100, config.get_localized_string(70183), config.get_localized_string(70181) % len(play_items))
|
||||
finally:
|
||||
progreso.close()
|
||||
|
||||
for x, i in enumerate(play_items):
|
||||
if not i.server and hasattr(channel, "play"):
|
||||
play_items[x] = getattr(channel, "play")(i)
|
||||
|
||||
seleccion = platformtools.dialog_select(config.get_localized_string(70192), ["Auto"] + [s.title for s in play_items])
|
||||
if seleccion > 1:
|
||||
if seleccion >= 1:
|
||||
update_json(item.path, {
|
||||
"downloadServer": {"url": play_items[seleccion - 1].url, "server": play_items[seleccion - 1].server}})
|
||||
return play_items[seleccion - 1]
|
||||
elif seleccion == 0:
|
||||
update_json(item.path, {"downloadServer": {}})
|
||||
|
||||
# platformtools.itemlist_update(item, True)
|
||||
return play_items[seleccion - 1]
|
||||
return play_items[0]
|
||||
# platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
def start_download(item):
|
||||
@@ -809,6 +819,9 @@ def get_episodes(item):
|
||||
|
||||
# El item es uma serie o temporada
|
||||
elif item.contentType in ["tvshow", "season"]:
|
||||
if item.downloadItemlist:
|
||||
episodes = [Item().fromurl(i) for i in item.downloadItemlist]
|
||||
else:
|
||||
# importamos el canal
|
||||
if item.contentChannel == 'community':
|
||||
channel = __import__('specials.%s' % item.contentChannel, None, None, ["specials.%s" % item.contentChannel])
|
||||
@@ -896,6 +909,12 @@ def write_json(item):
|
||||
|
||||
def save_download(item):
|
||||
logger.info()
|
||||
show_disclaimer()
|
||||
if item.channel != 'downloads':
|
||||
item.from_channel = item.channel
|
||||
item.from_action = item.action
|
||||
|
||||
item.channel = "downloads"
|
||||
item.action = "save_download_background"
|
||||
xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?" + item.tourl() + ")")
|
||||
|
||||
@@ -969,6 +988,9 @@ def save_download_movie(item):
|
||||
config.get_localized_string(30109))
|
||||
else:
|
||||
play_item = select_server(item)
|
||||
if play_item == 'Auto':
|
||||
start_download(item)
|
||||
else:
|
||||
play_item = item.clone(**play_item.__dict__)
|
||||
play_item.contentAction = play_item.action
|
||||
play_item.infoLabels = item.infoLabels
|
||||
@@ -980,7 +1002,7 @@ def save_download_tvshow(item):
|
||||
item.contentAction, item.contentChannel, item.contentType, item.contentSerieName))
|
||||
|
||||
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70188))
|
||||
|
||||
try:
|
||||
item.show = item.fulltitle
|
||||
scraper.find_and_set_infoLabels(item)
|
||||
if not item.contentSerieName: item.contentSerieName = item.fulltitle
|
||||
@@ -988,7 +1010,7 @@ def save_download_tvshow(item):
|
||||
item.downloadFilename = filetools.validate_path("%s [%s]" % (item.contentSerieName, item.infoLabels['IMDBNumber']))
|
||||
if config.get_setting("lowerize_title", "videolibrary"):
|
||||
item.downloadFilename = item.downloadFilename.lower()
|
||||
progreso.update(0, config.get_localized_string(70186), config.get_localized_string(70187) % item.contentChannel)
|
||||
progreso.update(0, config.get_localized_string(70186), config.get_localized_string(70180) % item.contentChannel)
|
||||
|
||||
episodes = get_episodes(item)
|
||||
|
||||
@@ -998,6 +1020,7 @@ def save_download_tvshow(item):
|
||||
progreso.update(old_div(x * 100, len(episodes)),
|
||||
"%dx%0.2d: %s" % (i.contentSeason, i.contentEpisodeNumber, i.contentTitle))
|
||||
write_json(i)
|
||||
finally:
|
||||
progreso.close()
|
||||
|
||||
if not platformtools.dialog_yesno(config.get_localized_string(30101), config.get_localized_string(70189)):
|
||||
@@ -1007,11 +1030,12 @@ def save_download_tvshow(item):
|
||||
else:
|
||||
if len(episodes) == 1:
|
||||
play_item = select_server(item)
|
||||
if play_item == 'Auto':
|
||||
start_download(item)
|
||||
else:
|
||||
play_item = item.clone(**play_item.__dict__)
|
||||
play_item.contentAction = play_item.action
|
||||
play_item.infoLabels = item.infoLabels
|
||||
from core import support
|
||||
support.dbg()
|
||||
start_download(play_item)
|
||||
else:
|
||||
for i in episodes:
|
||||
@@ -1027,3 +1051,10 @@ def set_movie_title(item):
|
||||
|
||||
if not item.contentTitle:
|
||||
item.contentTitle = re.sub("\[[^\]]+\]|\([^\)]+\)", "", item.title).strip()
|
||||
|
||||
|
||||
def show_disclaimer():
|
||||
line1 = config.get_localized_string(70690)
|
||||
line2 = config.get_localized_string(70691)
|
||||
line3 = config.get_localized_string(70692)
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), line1, line2, line3)
|
||||
|
||||
@@ -798,7 +798,7 @@ def channel_status(item, dict_values):
|
||||
|
||||
|
||||
def restore_tools(item):
|
||||
import videolibrary_service
|
||||
import service
|
||||
from core import videolibrarytools
|
||||
import os
|
||||
|
||||
@@ -832,7 +832,7 @@ def restore_tools(item):
|
||||
# filetools.rmdirtree(path)
|
||||
|
||||
# ... y la volvemos a añadir
|
||||
videolibrary_service.update(path, p_dialog, i, t, serie, 3)
|
||||
service.update(path, p_dialog, i, t, serie, 3)
|
||||
p_dialog.close()
|
||||
|
||||
# movies
|
||||
|
||||
@@ -667,8 +667,8 @@ def update_videolibrary(item):
|
||||
logger.info()
|
||||
|
||||
# Actualizar las series activas sobreescribiendo
|
||||
import videolibrary_service
|
||||
videolibrary_service.check_for_update(overwrite=True)
|
||||
import service
|
||||
service.check_for_update(overwrite=True)
|
||||
|
||||
# Eliminar las carpetas de peliculas que no contengan archivo strm
|
||||
for raiz, subcarpetas, ficheros in filetools.walk(videolibrarytools.MOVIES_PATH):
|
||||
@@ -692,8 +692,8 @@ def update_tvshow(item):
|
||||
p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), heading)
|
||||
p_dialog.update(0, heading, item.contentSerieName)
|
||||
|
||||
import videolibrary_service
|
||||
if videolibrary_service.update(item.path, p_dialog, 1, 1, item, False) and config.is_xbmc() and config.get_setting("videolibrary_kodi"):
|
||||
import service
|
||||
if service.update(item.path, p_dialog, 1, 1, item, False) and config.is_xbmc() and config.get_setting("videolibrary_kodi"):
|
||||
from platformcode import xbmc_videolibrary
|
||||
xbmc_videolibrary.update(folder=filetools.basename(item.path))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user