1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-16 14:25:02 -05:00

Fix for migrating to new newznab and torrent provider config formats

This commit is contained in:
echel0n 2014-08-28 22:52:02 -07:00
parent ae5644ba91
commit 6fd19de7e2

View File

@ -113,18 +113,18 @@ def makeNewznabProvider(configString):
enable_backlog = 0 enable_backlog = 0
try: 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: except ValueError:
try: logger.log(u"Skipping Newznab provider string: '" + configString + "', incorrect format", logger.ERROR)
name, url, key, catIDs, enabled, search_mode, search_fallback, enable_backlog = configString.split( return None
'|')
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
newznab = sys.modules['sickbeard.providers.newznab'] newznab = sys.modules['sickbeard.providers.newznab']
@ -161,18 +161,17 @@ def makeTorrentRssProvider(configString):
enable_backlog = 0 enable_backlog = 0
try: 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: except ValueError:
try: logger.log(u"Skipping RSS Torrent provider string: '" + configString + "', incorrect format",
name, url, enabled, search_mode, search_fallback, enable_daily, enable_backlog = configString.split('|') logger.ERROR)
except ValueError: return None
try:
name, url, enabled = configString.split('|')
except ValueError:
logger.log(u"Skipping RSS Torrent provider string: '" + configString + "', incorrect format",
logger.ERROR)
return None
try: try:
torrentRss = sys.modules['sickbeard.providers.rsstorrent'] torrentRss = sys.modules['sickbeard.providers.rsstorrent']