Solve conflict with 'HQ' pattern from audioProfile and other properties

This commit is contained in:
Toilal
2015-10-24 15:34:48 +02:00
parent 3c7bfa90cb
commit df56d69ef9
3 changed files with 75 additions and 1 deletions
+18
View File
@@ -114,3 +114,21 @@ class Ac3Rule(AudioProfileRule):
AUDIO_CODEC.rules(DtsRule, AacRule, Ac3Rule, AudioValidatorRule)
class HqConflictRule(RemoveMatchRule):
"""
Solve conflict between HQ from other property and from audioProfile.
"""
priority = 250 # Must run after AudioProfileRule
def when(self, matches, context):
hq_audio = matches.named('audioProfile', lambda match: match.value == 'HQ')
hq_audio_spans = [match.span for match in hq_audio]
hq_other = matches.named('other', lambda match: match.span in hq_audio_spans)
if hq_other:
return hq_other
AUDIO_CODEC.rules(HqConflictRule)
+51 -1
View File
@@ -518,4 +518,54 @@
format: BluRay
videoCodec: XviD
language: Spanish
title: Ejecutiva En Apuros
title: Ejecutiva En Apuros
? Die.Schluempfe.2.German.DL.1080p.BluRay.x264-EXQUiSiTE.mkv
: title: Die Schluempfe 2
format: BluRay
language:
- Multiple languages
- German
videoCodec: h264
releaseGroup: EXQUiSiTE
screenSize: 1080p
? Rocky 1976 French SubForced BRRip x264 AC3-FUNKY.mkv
: title: Rocky
year: 1976
subtitleLanguage: French
format: BluRay
videoCodec: h264
audioCodec: AC3
releaseGroup: FUNKY
? REDLINE (BD 1080p H264 10bit FLAC) [3xR].mkv
: title: REDLINE
format: BluRay
videoCodec: h264
videoProfile: 10bit
audioCodec: FLAC
screenSize: 1080p
? The.Lizzie.McGuire.Movie.(2003).HR.DVDRiP.avi
: title: The Lizzie McGuire Movie
year: 2003
format: DVD
other: HR
? Hua.Mulan.BRRIP.MP4.x264.720p-HR.avi
: title: Hua Mulan
videoCodec: h264
format: BluRay
screenSize: 720p
other: HR
? Dr.Seuss.The.Lorax.2012.DVDRip.LiNE.XviD.AC3.HQ.Hive-CM8.mp4
: videoCodec: XviD
title: Dr Seuss The Lorax
format: DVD
other: LiNE
year: 2012
audioCodec: AC3
audioProfile: HQ
releaseGroup: Hive-CM8
+6
View File
@@ -128,3 +128,9 @@
? +The complete movie
: title: The complete movie
? +AC3-HQ
: audioProfile: HQ
? Other-HQ
: other: HQ