def get_all_versions(item): logger.info() itemlist = [] # Lee la versión local from core import versiontools # Descarga la lista de versiones from core import api api_response = api.plugins_get_all_packages() if api_response["error"]: platformtools.dialog_ok( "Error", "Se ha producido un error al descargar la lista de versiones") return for entry in api_response["body"]: if entry["package"] == "plugin": title = "mitvspain " + entry["tag"] + " (Publicada " + entry[ "date"] + ")" local_version_number = versiontools.get_current_plugin_version() elif entry["package"] == "channels": title = "Canales (Publicada " + entry["date"] + ")" local_version_number = versiontools.get_current_channels_version() elif entry["package"] == "servers": title = "Servidores (Publicada " + entry["date"] + ")" local_version_number = versiontools.get_current_servers_version() else: title = entry["package"] + " (Publicada " + entry["date"] + ")" local_version_number = None title_color = "" if local_version_number is None: title = title elif entry["version"] == local_version_number: title += " ACTUAL" elif entry["version"] > local_version_number: title_color = "yellow" else: title_color = "0xFF666666" itemlist.append( Item(channel=CHANNELNAME, title=title, url=entry["url"], filename=entry["filename"], package=entry["package"], version=str(entry["version"]), text_color=title_color, action="download_and_install_package", folder=False)) return itemlist
def get_all_versions(item): logger.info() itemlist = [] # Lee la versión local from core import updater # Descarga la lista de versiones from core import api api_response = api.plugins_get_all_packages() if api_response["error"]: from platformcode import platformtools platformtools.dialog_ok( "Errore", "C'è stato un errore scaricando l'elenco delle versioni") return for entry in api_response["body"]: if entry["package"] == "plugin": title = "Stefano " + entry["tag"] + " (Publicada " + entry[ "date"] + ")" local_version_number = updater.get_current_plugin_version() elif entry["package"] == "channels": title = "Canales (Publicada " + entry["date"] + ")" local_version_number = updater.get_current_channels_version() elif entry["package"] == "servers": title = "Servidores (Publicada " + entry["date"] + ")" local_version_number = updater.get_current_servers_version() else: title = entry["package"] + " (Publicada " + entry["date"] + ")" local_version_number = None title_color = "" if local_version_number is None: title = title elif entry["version"] == local_version_number: title = title + " ACTUAL" elif entry["version"] > local_version_number: title = "[COLOR yellow]" + title + " ¡NUEVA VERSIÓN![/COLOR]" else: title = "[COLOR FF666666]" + title + "[/COLOR]" itemlist.append( Item(channel=CHANNELNAME, title=title, url=entry["url"], filename=entry["filename"], package=entry["package"], version=str(entry["version"]), action="download_and_install_package", folder=False)) return itemlist
def get_all_versions(item): logger.info() itemlist = [] # Lee la versión local from core import updater from core import versiontools # Descarga la lista de versiones from core import api api_response = api.plugins_get_all_packages() if api_response["error"]: platformtools.dialog_ok("Error", "Se ha producido un error al descargar la lista de versiones") return for entry in api_response["body"]: if entry["package"]=="plugin": title = "pelisalacarta "+entry["tag"]+" (Publicada "+entry["date"]+")" local_version_number = versiontools.get_current_plugin_version() elif entry["package"]=="channels": title = "Canales (Publicada "+entry["date"]+")" local_version_number = versiontools.get_current_channels_version() elif entry["package"]=="servers": title = "Servidores (Publicada "+entry["date"]+")" local_version_number = versiontools.get_current_servers_version() else: title = entry["package"]+" (Publicada "+entry["date"]+")" local_version_number = None title_color = "" if local_version_number is None: title = title elif entry["version"] == local_version_number: title = title + " ACTUAL" elif entry["version"] > local_version_number: title_color = "yellow" else: title_color = "0xFF666666" itemlist.append(Item(channel=CHANNELNAME, title=title, url=entry["url"], filename=entry["filename"], package=entry["package"], version=str(entry["version"]), text_color=title_color, action="download_and_install_package", folder=False)) return itemlist
def get_all_versions(item): logger.info() itemlist = [] # Lee la versión local from core import updater # Descarga la lista de versiones from core import api api_response = api.plugins_get_all_packages() if api_response["error"]: from platformcode import platformtools platformtools.dialog_ok("Errore", "C'è stato un errore scaricando l'elenco delle versioni") return for entry in api_response["body"]: if entry["package"]=="plugin": title = "streamondemand "+entry["tag"]+" (Publicada "+entry["date"]+")" local_version_number = updater.get_current_plugin_version() elif entry["package"]=="channels": title = "Canales (Publicada "+entry["date"]+")" local_version_number = updater.get_current_channels_version() elif entry["package"]=="servers": title = "Servidores (Publicada "+entry["date"]+")" local_version_number = updater.get_current_servers_version() else: title = entry["package"]+" (Publicada "+entry["date"]+")" local_version_number = None if local_version_number is None: title = title elif entry["version"] == local_version_number: title = title + " ACTUAL" elif entry["version"] > local_version_number: title = "[COLOR yellow]"+ title + " ¡NUEVA VERSIÓN![/COLOR]" else: title = "[COLOR FF666666]"+ title + "[/COLOR]" itemlist.append(Item(channel=CHANNELNAME, title=title, url=entry["url"], filename=entry["filename"], package=entry["package"], version=str(entry["version"]), action="download_and_install_package", folder=False)) return itemlist