Download nelle rispettive cartelle della videoteca

This commit is contained in:
Alhaziel
2019-08-01 17:38:37 +02:00
parent 8a79508fae
commit b29695acc5
2 changed files with 10 additions and 9 deletions

View File

@@ -340,7 +340,7 @@ def save_tvshow(item, episodelist):
'''msg = "Insertados: %d | Sobreescritos: %d | Fallidos: %d | Tiempo: %2.2f segundos" % \
(insertados, sobreescritos, fallidos, time.time() - start_time)
logger.debug(msg)'''
return insertados, sobreescritos, fallidos, path
@@ -398,8 +398,8 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
channel_alt = generictools.verify_channel(serie.channel) #Preparamos para añadir las urls de emergencia
emergency_urls_stat = config.get_setting("emergency_urls", channel_alt) #El canal quiere urls de emergencia?
emergency_urls_succ = False
#channel = __import__('channels.%s' % channel_alt, fromlist=["channels.%s" % channel_alt])
channel = __import__('specials.%s' % channel_alt, fromlist=["specials.%s" % channel_alt])
try: channel = __import__('specials.%s' % channel_alt, fromlist=["specials.%s" % channel_alt])
except: channel = __import__('channels.%s' % channel_alt, fromlist=["channels.%s" % channel_alt])
if serie.torrent_caching_fail: #Si el proceso de conversión ha fallado, no se cachean
emergency_urls_stat = 0
del serie.torrent_caching_fail

View File

@@ -263,9 +263,10 @@ def menu(item):
def move_to_libray(item):
download_path = filetools.join(config.get_setting("downloadpath"), item.downloadFilename)
library_path = filetools.join(config.get_videolibrary_path(), *filetools.split(item.downloadFilename))
library_path = filetools.join(config.get_videolibrary_path(), (config.get_setting("folder_movies") if item.contentType == 'movie' else config.get_setting("folder_tvshows")))
library_path = filetools.join(library_path, *filetools.split(item.downloadFilename))
final_path = download_path
if config.get_setting("library_add", "downloads") == True and config.get_setting("library_move", "downloads") == True:
if not filetools.isdir(filetools.dirname(library_path)):
filetools.mkdir(filetools.dirname(library_path))
@@ -293,7 +294,7 @@ def move_to_libray(item):
tvshow = Item(channel="downloads", contentType="tvshow",
infoLabels={"tmdb_id": item.infoLabels["tmdb_id"]})
videolibrarytools.save_tvshow(tvshow, [library_item])
def update_json(path, params):
item = Item().fromjson(filetools.read(path))
@@ -804,7 +805,7 @@ def save_download_movie(item):
progreso.update(0, config.get_localized_string(60062))
item.downloadFilename = filetools.validate_path("%s [%s]" % (item.contentTitle.strip(), item.contentChannel))
item.downloadFilename = filetools.validate_path("%s [%s] [%s]" % (item.contentTitle.strip(), item.contentChannel, item.infoLabels['IMDBNumber']))
write_json(item)
@@ -825,8 +826,8 @@ def save_download_tvshow(item):
item.show = item.fulltitle
scraper.find_and_set_infoLabels(item)
item.downloadFilename = filetools.validate_path("%s [%s]" % (item.contentSerieName, item.contentChannel))
logger.info('ID= ' + item.infoLabels['IMDBNumber'])
item.downloadFilename = filetools.validate_path("%s [%s]" % (item.contentSerieName, item.infoLabels['IMDBNumber']))
progreso.update(0, config.get_localized_string(70186), config.get_localized_string(70187) % item.contentChannel)