Private GIT

Skip to content
Snippets Groups Projects
Commit 349e72b5 authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Use exceptions from submodules, so we don't need to grab from github

parent c808c934
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ indexerConfig[INDEXER_TVRAGE] = {
indexerConfig[INDEXER_TVDB]['trakt_id'] = 'tvdb_id'
indexerConfig[INDEXER_TVDB]['xem_origin'] = 'tvdb'
indexerConfig[INDEXER_TVDB]['icon'] = 'thetvdb16.png'
indexerConfig[INDEXER_TVDB]['scene_url'] = 'http://sickragetv.github.io/sb_tvdb_scene_exceptions/exceptions.txt'
indexerConfig[INDEXER_TVDB]['scene_loc'] = 'lib/scene_exceptions/tvdb/exceptions.txt'
indexerConfig[INDEXER_TVDB]['show_url'] = 'http://thetvdb.com/?tab=series&id='
indexerConfig[INDEXER_TVDB]['base_url'] = 'http://thetvdb.com/api/%(apikey)s/series/' % indexerConfig[INDEXER_TVDB]['api_params']
......@@ -48,6 +48,6 @@ indexerConfig[INDEXER_TVDB]['base_url'] = 'http://thetvdb.com/api/%(apikey)s/ser
indexerConfig[INDEXER_TVRAGE]['trakt_id'] = 'tvrage_id'
indexerConfig[INDEXER_TVRAGE]['xem_origin'] = 'rage'
indexerConfig[INDEXER_TVRAGE]['icon'] = 'tvrage16.png'
indexerConfig[INDEXER_TVRAGE]['scene_url'] = 'http://sickragetv.github.io/sr_tvrage_scene_exceptions/exceptions.txt'
indexerConfig[INDEXER_TVRAGE]['scene_loc'] = 'lib/scene_exceptions/tvrage/exceptions.txt'
indexerConfig[INDEXER_TVRAGE]['show_url'] = 'http://tvrage.com/shows/id-'
indexerConfig[INDEXER_TVRAGE]['base_url'] = 'http://tvrage.com/showinfo.php?key=%(apikey)s&sid=' % indexerConfig[INDEXER_TVRAGE]['api_params']
......@@ -166,23 +166,28 @@ def retrieve_exceptions():
"""
global exception_dict, anidb_exception_dict, xem_exception_dict
# exceptions are stored on github pages
# exceptions are stored in submodules in this repo, sourced from the github repos
# TODO: `git submodule update`
for indexer in sickbeard.indexerApi().indexers:
if shouldRefresh(sickbeard.indexerApi(indexer).name):
logger.log(u"Checking for scene exception updates for " + sickbeard.indexerApi(indexer).name + "")
url = sickbeard.indexerApi(indexer).config['scene_url']
loc = sickbeard.indexerApi(indexer).config['scene_loc']
if loc.startswith("http"):
data = helpers.getURL(loc)
else:
with open(loc, 'r') as file:
data = file.read()
url_data = helpers.getURL(url)
if url_data is None:
# When urlData is None, trouble connecting to github
logger.log(u"Check scene exceptions update failed. Unable to get URL: " + url, logger.WARNING)
if data is None:
# When data is None, trouble connecting to github, or reading file failed
logger.log(u"Check scene exceptions update failed. Unable to update from: " + loc, logger.WARNING)
continue
setLastRefresh(sickbeard.indexerApi(indexer).name)
# each exception is on one line with the format indexer_id: 'show name 1', 'show name 2', etc
for cur_line in url_data.splitlines():
for cur_line in data.splitlines():
indexer_id, sep, aliases = cur_line.partition(':') # @UnusedVariable
if not aliases:
......@@ -197,7 +202,7 @@ def retrieve_exceptions():
del alias_list
# cleanup
del url_data
del data
# XEM scene exceptions
_xem_exceptions_fetcher()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment