mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Fixes for air_by_date and sports shows
Fixes for sports regex matching patterns.
This commit is contained in:
parent
42b11cd000
commit
eabd0d092f
@ -121,6 +121,14 @@ class NameParser(object):
|
||||
else:
|
||||
result.episode_numbers = [ep_num]
|
||||
|
||||
if 'sports_event_id' in named_groups:
|
||||
result.sports_event_id = int(match.group('sports_event_id'))
|
||||
|
||||
if 'sports_event_name' in named_groups:
|
||||
result.sports_event_name = match.group('sports_event_name')
|
||||
if result.sports_event_name:
|
||||
result.sports_event_name = self.clean_series_name(result.sports_event_name)
|
||||
|
||||
if 'sports_event_date' in named_groups:
|
||||
sports_event_date = match.group('sports_event_date')
|
||||
if sports_event_date:
|
||||
@ -235,6 +243,8 @@ class NameParser(object):
|
||||
final_result.air_date = self._combine_results(file_name_result, dir_name_result, 'air_date')
|
||||
|
||||
# sports event title
|
||||
final_result.sports_event_id = self._combine_results(file_name_result, dir_name_result, 'sports_event_id')
|
||||
final_result.sports_event_name = self._combine_results(file_name_result, dir_name_result, 'sports_event_name')
|
||||
final_result.sports_event_date = self._combine_results(file_name_result, dir_name_result, 'sports_event_date')
|
||||
|
||||
if not final_result.air_date:
|
||||
@ -272,6 +282,8 @@ class ParseResult(object):
|
||||
def __init__(self,
|
||||
original_name,
|
||||
series_name=None,
|
||||
sports_event_id=None,
|
||||
sports_event_name=None,
|
||||
sports_event_date=None,
|
||||
season_number=None,
|
||||
episode_numbers=None,
|
||||
@ -296,6 +308,8 @@ class ParseResult(object):
|
||||
|
||||
self.air_date = air_date
|
||||
|
||||
self.sports_event_id = sports_event_id
|
||||
self.sports_event_name = sports_event_name
|
||||
self.sports_event_date = sports_event_date
|
||||
|
||||
self.which_regex = None
|
||||
@ -316,6 +330,10 @@ class ParseResult(object):
|
||||
return False
|
||||
if self.air_date != other.air_date:
|
||||
return False
|
||||
if self.sports_event_id != other.sports_event_id:
|
||||
return False
|
||||
if self.sports_event_name != other.sports_event_name:
|
||||
return False
|
||||
if self.sports_event_date != other.sports_event_date:
|
||||
return False
|
||||
|
||||
@ -335,6 +353,8 @@ class ParseResult(object):
|
||||
if self.air_by_date:
|
||||
to_return += str(self.air_date)
|
||||
if self.sports:
|
||||
to_return += str(self.sports_event_name)
|
||||
to_return += str(self.sports_event_id)
|
||||
to_return += str(self.sports_event_date)
|
||||
|
||||
if self.extra_info:
|
||||
|
@ -193,7 +193,8 @@ sports_regexs = [
|
||||
# Sports.Name.23rd.Nov.2010.Source.Quality.Etc-Group
|
||||
'''
|
||||
^(?P<series_name>(UEFA|MLB|ESPN|WWE|MMA|UFC|TNA|EPL|NASCAR|NBA|NFL|NHL|NRL|PGA|SUPER LEAGUE|FORMULA|FIFA|NETBALL|MOTOGP))[. _-]+
|
||||
(P<sports_event_name>.*?)[. _-]+
|
||||
((?P<sports_event_id>\d{3})[. _-]+)?
|
||||
((?P<sports_event_name>\w+)[. _-]+)?
|
||||
(?P<sports_event_date>(\d{4}[. _-]+\d{1,2}[. _-]+\d{1,2})|(\d{1,2}\w{2}[. _-]+\w+[. _-]+\d{4}))
|
||||
[. _-]*((?P<extra_info>.+?)((?<![. _-])(?<!WEB)
|
||||
-(?P<release_group>[^- ]+))?)?$
|
||||
|
@ -58,7 +58,7 @@ class GenericProvider:
|
||||
self.session = requests.session()
|
||||
self.session.verify = False
|
||||
self.session.headers.update({
|
||||
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'})
|
||||
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'})
|
||||
|
||||
|
||||
def getID(self):
|
||||
@ -283,7 +283,6 @@ class GenericProvider:
|
||||
logger.log(u"Unable to parse the filename " + title + " into a valid episode", logger.WARNING)
|
||||
continue
|
||||
|
||||
|
||||
if not useDate:
|
||||
# this check is meaningless for non-season searches
|
||||
if (parse_result.season_number is not None and parse_result.season_number != season) or (
|
||||
@ -292,7 +291,8 @@ class GenericProvider:
|
||||
season) + ", ignoring", logger.DEBUG)
|
||||
continue
|
||||
|
||||
if manualSearch and (parse_result.season_number != season or ep_objs[0].episode not in parse_result.episode_numbers):
|
||||
if manualSearch and (
|
||||
parse_result.season_number != season or ep_objs[0].episode not in parse_result.episode_numbers):
|
||||
logger.log(u"Episode " + title + " isn't " + str(season) + "x" + str(
|
||||
ep_objs[0].episode) + ", skipping it", logger.DEBUG)
|
||||
continue
|
||||
@ -301,13 +301,14 @@ class GenericProvider:
|
||||
actual_season = season if manualSearch else parse_result.season_number
|
||||
actual_episodes = [ep_objs[0].episode] if manualSearch else parse_result.episode_numbers
|
||||
else:
|
||||
if not (parse_result.air_by_date,parse_result.sports_event_date):
|
||||
if not (parse_result.air_by_date or parse_result.sports):
|
||||
logger.log(
|
||||
u"This is supposed to be an date search but the result " + title + " didn't parse as one, skipping it",
|
||||
u"This is supposed to be a date search but the result " + title + " didn't parse as one, skipping it",
|
||||
logger.DEBUG)
|
||||
continue
|
||||
|
||||
if manualSearch and parse_result.air_date != ep_objs[0].airdate:
|
||||
if manualSearch and ((parse_result.air_date != ep_objs[0].airdate and parse_result.air_by_date) or (
|
||||
parse_result.sports_event_date != ep_objs[0].airdate and parse_result.sports)):
|
||||
logger.log(u"Episode " + title + " didn't air on " + str(ep_objs[0].airdate) + ", skipping it",
|
||||
logger.DEBUG)
|
||||
continue
|
||||
@ -338,7 +339,8 @@ class GenericProvider:
|
||||
wantEp = True
|
||||
for epNo in actual_episodes:
|
||||
epObj = self.show.getEpisode(actual_season, epNo)
|
||||
if not epObj or not self.show.wantEpisode(epObj.season, epObj.episode, quality, manualSearch=manualSearch):
|
||||
if not epObj or not self.show.wantEpisode(epObj.season, epObj.episode, quality,
|
||||
manualSearch=manualSearch):
|
||||
wantEp = False
|
||||
break
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user