From cd08343d56193956d4b5a15511af0ebcc70507f5 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Sat, 1 Feb 2020 17:36:27 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20Vidoteca=20e=20download=20in=20unit=C3=A0?= =?UTF-8?q?=20di=20rete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/videolibrarytools.py | 6 ++++-- specials/downloads.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index da695886..5357bd28 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -225,6 +225,8 @@ def save_movie(item): def filter_list(episodelist, action=None, path=None): if path: path = path.decode('utf8') + # import xbmc + # if xbmc.getCondVisibility('system.platform.windows') > 0: path = path.replace('smb:','').replace('/','\\') channel_prefs = {} lang_sel = quality_sel = show_title = channel ='' if action: @@ -234,10 +236,10 @@ def filter_list(episodelist, action=None, path=None): show_title = tvshow_item.infoLabels['tvshowtitle'] if not tvshow_item.channel_prefs: tvshow_item.channel_prefs={channel:{}} - list_item = os.listdir(path) + list_item = filetools.listdir(path) for File in list_item: if (File.endswith('.strm') or File.endswith('.json') or File.endswith('.nfo')): - os.remove(os.path.join(path, File)) + filetools.remove(filetools.join(path, File)) if channel not in tvshow_item.channel_prefs: tvshow_item.channel_prefs[channel] = {} channel_prefs = tvshow_item.channel_prefs[channel] diff --git a/specials/downloads.py b/specials/downloads.py index 4f65e889..2f42dcf9 100644 --- a/specials/downloads.py +++ b/specials/downloads.py @@ -302,7 +302,7 @@ def move_to_libray(item): logger.info('ITEM = ' + str(item)) name = item.contentTitle if item.contentType == 'movie' else str(item.infoLabels['season']) + 'x' + str(item.infoLabels['episode']).zfill(2) - list_item = os.listdir(filetools.join(config.get_videolibrary_path(), FOLDER, path_title)) + list_item = filetools.listdir(filetools.join(config.get_videolibrary_path(), FOLDER, path_title)) clean = False for File in list_item: @@ -310,8 +310,8 @@ def move_to_libray(item): name = name.lower() if filename.startswith(name) and (filename.endswith('.strm') or filename.endswith('.json') or filename.endswith('.nfo')): clean = True - logger.info('Delete File: ' + str(os.path.join(config.get_videolibrary_path(), FOLDER, path_title, File))) - os.remove(os.path.join(config.get_videolibrary_path(), FOLDER, path_title, File)) + logger.info('Delete File: ' + str(filetools.join(config.get_videolibrary_path(), FOLDER, path_title, File))) + filetools.remove(filetools.join(config.get_videolibrary_path(), FOLDER, path_title, File)) from platformcode import xbmc_videolibrary