Skip to content

Commit

Permalink
fix(frame_rate): enhance frame_rate when ending with .000 or spac…
Browse files Browse the repository at this point in the history
…e separated (#693)
  • Loading branch information
Toilal committed Apr 29, 2021
1 parent 066a9dd commit dba9cef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions guessit/config/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,15 @@
},
"screen_size": {
"frame_rates": [
"23.976",
"24",
"25",
"29.970",
"30",
"48",
"50",
"60",
"120"
"23\\.976",
"24(?:\\.0{1,3})?",
"25(?:\\.0{1,3})?",
"29\\.970",
"30(?:\\.0{1,3})?",
"48(?:\\.0{1,3})?",
"50(?:\\.0{1,3})?",
"60(?:\\.0{1,3})?",
"120(?:\\.0{1,3})?"
],
"min_ar": 1.333,
"max_ar": 1.898,
Expand Down
4 changes: 2 additions & 2 deletions guessit/rules/properties/screen_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def screen_size(config):
"""
interlaced = frozenset(config['interlaced'])
progressive = frozenset(config['progressive'])
frame_rates = [re.escape(rate) for rate in config['frame_rates']]
frame_rates = frozenset(config['frame_rates'])
min_ar = config['min_ar']
max_ar = config['max_ar']

Expand All @@ -49,7 +49,7 @@ def screen_size(config):
rebulk.regex(r'(?P<width>\d{3,4})-?(?:x|\*)-?(?P<height>\d{3,4})',
conflict_solver=lambda match, other: '__default__' if other.name == 'screen_size' else other)

rebulk.regex(frame_rate_pattern + '(p|fps)', name='frame_rate',
rebulk.regex(frame_rate_pattern + '-?(?:p|fps)', name='frame_rate',
formatter=FrameRate.fromstring, disabled=lambda context: is_disabled(context, 'frame_rate'))

rebulk.rules(PostProcessScreenSize(progressive, min_ar, max_ar), ScreenSizeOnlyOne, ResolveScreenSizeConflicts)
Expand Down

0 comments on commit dba9cef

Please sign in to comment.