From 71da044f48dfc8684baf5b5ace20cbce4d629034 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Wed, 24 Feb 2021 20:58:39 +0100 Subject: [PATCH] fix serie flaggate come conluse + typo --- channels/cineblog01.py | 2 +- service.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index 76ae02e9..917ee877 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -37,7 +37,7 @@ def mainlist(item): ('Ultime Aggiornate', ['/serietv/', 'peliculas', 'newest']) ] docu = [('Documentari {bullet bold}', ['/category/documentario/', 'peliculas']), - ('HD {submenu} {documentari}', ['category/hd-alta-definizione/documentario-hd/', 'peliculas']) + ('HD {submenu} {documentari}', ['/category/hd-alta-definizione/documentario-hd/', 'peliculas']) ] return locals() diff --git a/service.py b/service.py index 2d9ea85d..61ef35c5 100644 --- a/service.py +++ b/service.py @@ -122,7 +122,6 @@ def check_for_update(overwrite=True): update_when_finished = False hoy = datetime.date.today() estado_verify_playcount_series = False - local_ended = True try: if config.get_setting("update", "videolibrary") != 0 or overwrite: @@ -132,18 +131,21 @@ def check_for_update(overwrite=True): p_dialog = platformtools.dialog_progress_bg(config.get_localized_string(20000), heading) p_dialog.update(0, '') show_list = [] + show_ep_num = [] for path, folders, files in filetools.walk(videolibrarytools.TVSHOWS_PATH): - show_list.extend([filetools.join(path, f) for f in files if f == "tvshow.nfo"]) + if 'tvshow.nfo' in files: + show_list.extend([filetools.join(path, f) for f in files if f == "tvshow.nfo"]) + show_ep_num.append(len([f for f in files if f.endswith('.nfo') and f != 'tvshow.nfo'])) if show_list: t = float(100) / len(show_list) for i, tvshow_file in enumerate(show_list): head_nfo, serie = videolibrarytools.read_nfo(tvshow_file) - if serie.local_episodes_path: - local_ended = True if serie.infoLabels['number_of_episodes'] == len(serie.local_episodes_list) else False - if serie.infoLabels['status'].lower() == 'ended' and local_ended: + ep_count = show_ep_num[i] + (len(serie.local_episodes_list) if serie.local_episodes_path else 0) + if serie.infoLabels['status'].lower() == 'ended' and \ + ep_count >= serie.infoLabels['number_of_episodes']: serie.active = 0 filetools.write(tvshow_file, head_nfo + serie.tojson()) path = filetools.dirname(tvshow_file)