From 2389f61b91fd850f1fb7e7d90b6a5d11d7dc6c74 Mon Sep 17 00:00:00 2001 From: Croneter Date: Wed, 20 Jun 2018 12:30:05 +0200 Subject: [PATCH] Speed up subtitle download to Kodi --- resources/lib/PlexAPI.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 612fa933..c6416d2f 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -54,6 +54,9 @@ LOG = getLogger("PLEX." + __name__) REGEX_IMDB = re_compile(r'''/(tt\d+)''') REGEX_TVDB = re_compile(r'''thetvdb:\/\/(.+?)\?''') +if not exists_dir(v.EXTERNAL_SUBTITLE_TEMP_PATH): + makedirs(v.EXTERNAL_SUBTITLE_TEMP_PATH) + ############################################################################### @@ -1400,8 +1403,6 @@ class API(object): Returns the path to the downloaded subtitle or None """ - if not exists_dir(v.EXTERNAL_SUBTITLE_TEMP_PATH): - makedirs(v.EXTERNAL_SUBTITLE_TEMP_PATH) path = join(v.EXTERNAL_SUBTITLE_TEMP_PATH, filename) response = DU().downloadUrl(url, return_response=True) try: