mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 19:42:20 -05:00
Fixed naming issues for sports and air-by-date shows.
This commit is contained in:
parent
7b187c3add
commit
818536fcb4
@ -167,25 +167,23 @@ class NameParser(object):
|
|||||||
|
|
||||||
if 'sports_air_date' in named_groups:
|
if 'sports_air_date' in named_groups:
|
||||||
sports_air_date = match.group('sports_air_date')
|
sports_air_date = match.group('sports_air_date')
|
||||||
if result.show and result.show.is_sports:
|
try:
|
||||||
try:
|
result.sports_air_date = parser.parse(sports_air_date, fuzzy=True).date()
|
||||||
result.sports_air_date = parser.parse(sports_air_date, fuzzy=True).date()
|
result.score += 1
|
||||||
result.score += 1
|
except:
|
||||||
except:
|
continue
|
||||||
continue
|
|
||||||
|
|
||||||
if 'air_year' in named_groups and 'air_month' in named_groups and 'air_day' in named_groups:
|
if 'air_year' in named_groups and 'air_month' in named_groups and 'air_day' in named_groups:
|
||||||
if result.show and result.show.air_by_date:
|
year = int(match.group('air_year'))
|
||||||
year = int(match.group('air_year'))
|
month = int(match.group('air_month'))
|
||||||
month = int(match.group('air_month'))
|
day = int(match.group('air_day'))
|
||||||
day = int(match.group('air_day'))
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dtStr = '%s-%s-%s' % (year, month, day)
|
dtStr = '%s-%s-%s' % (year, month, day)
|
||||||
result.air_date = datetime.datetime.strptime(dtStr, "%Y-%m-%d").date()
|
result.air_date = datetime.datetime.strptime(dtStr, "%Y-%m-%d").date()
|
||||||
result.score += 1
|
result.score += 1
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if 'extra_info' in named_groups:
|
if 'extra_info' in named_groups:
|
||||||
tmp_extra_info = match.group('extra_info')
|
tmp_extra_info = match.group('extra_info')
|
||||||
|
Loading…
Reference in New Issue
Block a user