1
0
mirror of https://github.com/moparisthebest/SickRage synced 2025-01-05 19:08:02 -05:00

Merge pull request #937 from miigotu/develop

Strip year from show title when adding existing shows, so show is found ...
This commit is contained in:
echel0n 2014-11-23 05:28:22 -08:00
commit 06d14d3450

View File

@ -2884,18 +2884,19 @@ class NewHomeAddShows(MainHandler):
indexer_id = show_name = indexer = None indexer_id = show_name = indexer = None
for cur_provider in sickbeard.metadata_provider_dict.values(): 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 # default to TVDB if indexer was not detected
if show_name and not (indexer or indexer_id): if show_name and not (indexer or indexer_id):
(sn, idx, id) = helpers.searchIndexerForShowID(show_name, indexer, indexer_id) (sn, idx, id) = helpers.searchIndexerForShowID(show_name, indexer, indexer_id)
# set indexer and indexer_id from found info # set indexer and indexer_id from found info
if not indexer and idx: if not indexer and idx:
indexer = idx indexer = idx
if not indexer_id and id: if not indexer_id and id:
indexer_id = id indexer_id = id
cur_dir['existing_info'] = (indexer_id, show_name, indexer) cur_dir['existing_info'] = (indexer_id, show_name, indexer)
@ -2929,7 +2930,7 @@ class NewHomeAddShows(MainHandler):
if not show_dir: if not show_dir:
t.default_show_name = '' t.default_show_name = ''
elif not 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: else:
t.default_show_name = show_name t.default_show_name = show_name