-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix HDD release group detected as DolbyDigital
Close #317
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,24 @@ def audio_codec(): | |
:rtype: Rebulk | ||
""" | ||
rebulk = Rebulk().regex_defaults(flags=re.IGNORECASE, abbreviations=[dash]).string_defaults(ignore_case=True) | ||
rebulk.defaults(name="audio_codec") | ||
|
||
def audio_codec_priority(match1, match2): | ||
""" | ||
Gives priority to audio_codec | ||
:param match1: | ||
:type match1: | ||
:param match2: | ||
:type match2: | ||
:return: | ||
:rtype: | ||
""" | ||
if match1.name == 'audio_codec' and match2.name in ['audio_profile', 'audio_channels']: | ||
return match2 | ||
if match1.name == ['audio_profile', 'audio_channels'] and match2.name == 'audio_codec': | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Toilal
via email
Author
Member
|
||
return match1 | ||
return '__default__' | ||
|
||
rebulk.defaults(name="audio_codec", conflict_solver=audio_codec_priority) | ||
|
||
rebulk.regex("MP3", "LAME", r"LAME(?:\d)+-?(?:\d)+", value="MP3") | ||
rebulk.regex("Dolby", "DolbyDigital", "Dolby-Digital", "DD", value="DolbyDigital") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shouldn't be
in
instead of==
?