1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Strip year from show title when adding existing shows, so show is found on TVDB. Fix processing of NFO.

This commit is contained in:
Dustyn Gibson 2014-11-22 18:39:29 -08:00
parent de23635e28
commit ed00cbc053

View File

@ -2876,18 +2876,19 @@ class NewHomeAddShows(MainHandler):
indexer_id = show_name = indexer = None
for cur_provider in sickbeard.metadata_provider_dict.values():
(indexer_id, show_name, indexer) = cur_provider.retrieveShowMetadata(cur_path)
if not (indexer_id and show_name):
(indexer_id, show_name, indexer) = cur_provider.retrieveShowMetadata(cur_path)
# default to TVDB if indexer was not detected
if show_name and not (indexer or indexer_id):
(sn, idx, id) = helpers.searchIndexerForShowID(show_name, indexer, indexer_id)
# default to TVDB if indexer was not detected
if show_name and not (indexer or indexer_id):
(sn, idx, id) = helpers.searchIndexerForShowID(show_name, indexer, indexer_id)
# set indexer and indexer_id from found info
if not indexer and idx:
indexer = idx
# set indexer and indexer_id from found info
if not indexer and idx:
indexer = idx
if not indexer_id and id:
indexer_id = id
if not indexer_id and id:
indexer_id = id
cur_dir['existing_info'] = (indexer_id, show_name, indexer)
@ -2921,7 +2922,7 @@ class NewHomeAddShows(MainHandler):
if not show_dir:
t.default_show_name = ''
elif not show_name:
t.default_show_name = ek.ek(os.path.basename, ek.ek(os.path.normpath, show_dir)).replace('.', ' ')
t.default_show_name = re.sub(' \(\d{4}\)','', ek.ek(os.path.basename, ek.ek(os.path.normpath, show_dir)).replace('.', ' '))
else:
t.default_show_name = show_name