From 6fd19de7e23627785b31283c6d3d69c254f80181 Mon Sep 17 00:00:00 2001 From: echel0n Date: Thu, 28 Aug 2014 22:52:02 -0700 Subject: [PATCH] Fix for migrating to new newznab and torrent provider config formats --- sickbeard/providers/__init__.py | 43 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/sickbeard/providers/__init__.py b/sickbeard/providers/__init__.py index 3ae9c75d..e4b97e7d 100755 --- a/sickbeard/providers/__init__.py +++ b/sickbeard/providers/__init__.py @@ -113,18 +113,18 @@ def makeNewznabProvider(configString): enable_backlog = 0 try: - name, url, key, catIDs, enabled, search_mode, search_fallback, enable_daily, enable_backlog = configString.split( - '|') + values = configString.split('|') + if len(values) == 9: + name, url, key, catIDs, enabled, search_mode, search_fallback, enable_daily, enable_backlog = values + else: + name = values[0] + url = values[1] + key = values[2] + catIDs = values[3] + enabled = values[4] except ValueError: - try: - name, url, key, catIDs, enabled, search_mode, search_fallback, enable_backlog = configString.split( - '|') - except ValueError: - try: - name, url, key, catIDs, enabled = configString.split('|') - except ValueError: - logger.log(u"Skipping Newznab provider string: '" + configString + "', incorrect format", logger.ERROR) - return None + logger.log(u"Skipping Newznab provider string: '" + configString + "', incorrect format", logger.ERROR) + return None newznab = sys.modules['sickbeard.providers.newznab'] @@ -161,18 +161,17 @@ def makeTorrentRssProvider(configString): enable_backlog = 0 try: - name, url, cookies, enabled, search_mode, search_fallback, enable_daily, enable_backlog = configString.split( - '|') + values = configString.split('|') + if len(values) == 8: + name, url, cookies, enabled, search_mode, search_fallback, enable_daily, enable_backlog = values + else: + name = values[0] + url = values[1] + enabled = values[3] except ValueError: - try: - name, url, enabled, search_mode, search_fallback, enable_daily, enable_backlog = configString.split('|') - except ValueError: - try: - name, url, enabled = configString.split('|') - except ValueError: - logger.log(u"Skipping RSS Torrent provider string: '" + configString + "', incorrect format", - logger.ERROR) - return None + logger.log(u"Skipping RSS Torrent provider string: '" + configString + "', incorrect format", + logger.ERROR) + return None try: torrentRss = sys.modules['sickbeard.providers.rsstorrent']