Migliorie download
This commit is contained in:
@@ -294,6 +294,8 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
logger.info("Servidor importado: %s" % server_module)
|
||||
except:
|
||||
server_module = None
|
||||
if muestra_dialogo:
|
||||
progreso.close()
|
||||
logger.error("No se ha podido importar el servidor: %s" % server)
|
||||
import traceback
|
||||
logger.error(traceback.format_exc())
|
||||
@@ -307,6 +309,8 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
if not video_exists:
|
||||
error_messages.append(message)
|
||||
logger.info("test_video_exists dice que el video no existe")
|
||||
if muestra_dialogo:
|
||||
progreso.close()
|
||||
else:
|
||||
logger.info("test_video_exists dice que el video SI existe")
|
||||
except:
|
||||
|
||||
@@ -13,8 +13,6 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 2.0.4\n"
|
||||
"Last-Translator: MrTruth\n"
|
||||
"Last-Translator: Angedam\n"
|
||||
"Language: en_EN\n"
|
||||
|
||||
msgctxt "#20000"
|
||||
@@ -375,7 +373,7 @@ msgid "Square"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30300"
|
||||
msgid "Faster context menus"
|
||||
msgid "Delete also downloaded files?"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#30501"
|
||||
|
||||
@@ -13,8 +13,6 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 2.0.4\n"
|
||||
"Last-Translator: MrTruth\n"
|
||||
"Last-Translator: Angedam\n"
|
||||
"Language: it_IT\n"
|
||||
|
||||
msgctxt "#20000"
|
||||
@@ -374,8 +372,8 @@ msgid "Square"
|
||||
msgstr "Square"
|
||||
|
||||
msgctxt "#30300"
|
||||
msgid "Faster context menus"
|
||||
msgstr "Menu contestuali rapidi (possono causare il mancato funzionamento di alcune opzioni)"
|
||||
msgid "Delete also downloaded files?"
|
||||
msgstr "Cancellare anche i file scaricati?"
|
||||
|
||||
msgctxt "#30501"
|
||||
msgid "Path and folders"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<setting id="thumbnail_type" type="select" lvalues="30011|30012|30200" label="30010" default="2"/>
|
||||
<setting id="channel_language" type="select" values="auto|all|ita" label="30019" default="all"/>
|
||||
<setting id="forceview" type="bool" label="30043" default="false"/>
|
||||
<!-- <setting id="faster_item_serialization" type="bool" label="30300" default="false"/> -->
|
||||
<setting type="sep"/>
|
||||
<setting id="trakt_sync" type="bool" label="70109" default="false"/>
|
||||
<setting id="resolver_dns" type="bool" label="707408" default="true" enable="true" visible="true"/>
|
||||
|
||||
@@ -14,7 +14,6 @@ from past.utils import old_div
|
||||
import re
|
||||
import time
|
||||
import unicodedata
|
||||
from threading import Thread
|
||||
import xbmc
|
||||
|
||||
from channelselector import get_thumb
|
||||
@@ -180,6 +179,9 @@ def del_dir(item):
|
||||
def clean_all(item):
|
||||
logger.info()
|
||||
stop_all()
|
||||
removeFiles = False
|
||||
if platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(30300)):
|
||||
removeFiles = True
|
||||
|
||||
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
|
||||
if fichero.endswith(".json"):
|
||||
@@ -187,6 +189,9 @@ def clean_all(item):
|
||||
if not item.contentType == "tvshow" or (
|
||||
item.contentSerieName == download_item.contentSerieName and item.contentChannel == download_item.contentChannel):
|
||||
filetools.remove(filetools.join(DOWNLOAD_LIST_PATH, fichero))
|
||||
if removeFiles:
|
||||
filetools.remove(filetools.join(DOWNLOAD_PATH, download_item.downloadFilename))
|
||||
|
||||
xbmc.sleep(100)
|
||||
platformtools.itemlist_refresh()
|
||||
|
||||
@@ -231,9 +236,9 @@ def restart_error(item):
|
||||
item.contentSerieName == download_item.contentSerieName and item.contentChannel == download_item.contentChannel):
|
||||
if download_item.downloadStatus == STATUS_CODES.error:
|
||||
if filetools.isfile(
|
||||
filetools.join(config.get_setting("downloadpath"), download_item.downloadFilename)):
|
||||
filetools.join(DOWNLOAD_PATH, download_item.downloadFilename)):
|
||||
filetools.remove(
|
||||
filetools.join(config.get_setting("downloadpath"), download_item.downloadFilename))
|
||||
filetools.join(DOWNLOAD_PATH, download_item.downloadFilename))
|
||||
|
||||
update_json(item.path,
|
||||
{"downloadStatus": STATUS_CODES.stoped, "downloadComplete": 0, "downloadProgress": 0})
|
||||
@@ -312,6 +317,8 @@ def menu(item):
|
||||
# Opcion Eliminar
|
||||
if opciones[seleccion] == op[1]:
|
||||
filetools.remove(item.path)
|
||||
if platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(30300)):
|
||||
filetools.remove(filetools.join(DOWNLOAD_PATH, item.downloadFilename))
|
||||
|
||||
# Opcion inicaiar descarga
|
||||
if opciones[seleccion] == op[0]:
|
||||
@@ -324,8 +331,8 @@ def menu(item):
|
||||
|
||||
# Reiniciar descarga
|
||||
if opciones[seleccion] == op[2]:
|
||||
if filetools.isfile(filetools.join(config.get_setting("downloadpath"), item.downloadFilename)):
|
||||
filetools.remove(filetools.join(config.get_setting("downloadpath"), item.downloadFilename))
|
||||
if filetools.isfile(filetools.join(DOWNLOAD_PATH, item.downloadFilename)):
|
||||
filetools.remove(filetools.join(DOWNLOAD_PATH, item.downloadFilename))
|
||||
|
||||
update_json(item.path, {"downloadStatus": STATUS_CODES.stoped, "downloadComplete": 0, "downloadProgress": 0,
|
||||
"downloadServer": {}})
|
||||
@@ -355,7 +362,7 @@ def move_to_libray(item):
|
||||
path_title = "%s [%s]" % (title, item.infoLabels['IMDBNumber'])
|
||||
move_path = filetools.join(config.get_videolibrary_path(), FOLDER)
|
||||
|
||||
download_path = filetools.join(config.get_setting("downloadpath"), item.downloadFilename)
|
||||
download_path = filetools.join(DOWNLOAD_PATH, item.downloadFilename)
|
||||
library_path = filetools.join(move_path, *filetools.split(item.downloadFilename))
|
||||
final_path = download_path
|
||||
|
||||
@@ -569,7 +576,7 @@ def download_from_url(url, item):
|
||||
return {"downloadStatus": STATUS_CODES.error}
|
||||
|
||||
# Obtenemos la ruta de descarga y el nombre del archivo
|
||||
item.downloadFilename = item.downloadFilename.replace('/','-')
|
||||
item.downloadFilename = item.downloadFilename
|
||||
download_path = filetools.dirname(filetools.join(DOWNLOAD_PATH, item.downloadFilename))
|
||||
file_name = filetools.basename(filetools.join(DOWNLOAD_PATH, item.downloadFilename))
|
||||
|
||||
@@ -784,7 +791,7 @@ def select_server(item):
|
||||
return play_items[seleccion - 1]
|
||||
elif seleccion == 0:
|
||||
update_json(item.path, {"downloadServer": {}})
|
||||
return play_items[0]
|
||||
return 'Auto'
|
||||
# platformtools.itemlist_refresh()
|
||||
|
||||
|
||||
@@ -902,7 +909,7 @@ def write_json(item):
|
||||
if name in item.__dict__:
|
||||
item.__dict__.pop(name)
|
||||
|
||||
path = filetools.join(config.get_setting("downloadlistpath"), str(time.time()) + ".json")
|
||||
path = filetools.join(DOWNLOAD_LIST_PATH, str(time.time()) + ".json")
|
||||
item.path = path
|
||||
filetools.write(path, item.tojson())
|
||||
time.sleep(0.1)
|
||||
@@ -922,7 +929,6 @@ def save_download(item):
|
||||
|
||||
def save_download_background(item):
|
||||
logger.info()
|
||||
|
||||
# Menu contextual
|
||||
if item.from_action and item.from_channel:
|
||||
item.channel = item.from_channel
|
||||
|
||||
Reference in New Issue
Block a user