Skip to content

Commit

Permalink
fix(options): fix custom options.json groups starting/ending (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Feb 5, 2021
1 parent 4b1fa77 commit 69c5741
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions guessit/config/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"sub"
],
"groups": {
"starting": "([{",
"ending": ")]}"
"starting": "([{",
"ending": ")]}"
},
"audio_codec": {
"audio_channels": {
Expand Down
6 changes: 5 additions & 1 deletion guessit/rules/markers/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
from rebulk import Rebulk

from ...options import ConfigurationException

def groups(config):
"""
Expand All @@ -21,14 +22,17 @@ def groups(config):
starting = config['starting']
ending = config['ending']

if len(starting) != len(ending):
raise ConfigurationException("Starting and ending groups must have the same length")

def mark_groups(input_string):
"""
Functional pattern to mark groups (...), [...] and {...}.
:param input_string:
:return:
"""
openings = ([], [], [])
openings = ([], ) * len(starting)
i = 0

ret = []
Expand Down

0 comments on commit 69c5741

Please sign in to comment.