diff --git a/backend/app/compile/format_compiler.py b/backend/app/compile/format_compiler.py index 54ed014..427d3cb 100644 --- a/backend/app/compile/format_compiler.py +++ b/backend/app/compile/format_compiler.py @@ -51,14 +51,15 @@ class FormatConverter: target_app: TargetApp) -> Optional[Specification]: condition_type = condition['type'] - if condition_type in ['release_title', 'release_group']: + if condition_type in ['release_title', 'release_group', 'edition']: pattern_name = condition['pattern'] pattern = self.patterns.get(pattern_name) if not pattern: return None implementation = ('ReleaseTitleSpecification' if condition_type == 'release_title' else - 'ReleaseGroupSpecification') + 'ReleaseGroupSpecification' if condition_type + == 'release_group' else 'EditionSpecification') fields = [{'name': 'value', 'value': pattern}] elif condition_type == 'source': @@ -77,6 +78,14 @@ class FormatConverter: target_app) fields = [{'name': 'value', 'value': value}] + elif condition_type == 'quality_modifier': + if target_app == TargetApp.SONARR: + return None + implementation = 'QualityModifierSpecification' + value = ValueResolver.get_quality_modifier( + condition['qualityModifier']) + fields = [{'name': 'value', 'value': value}] + elif condition_type == 'language': implementation = 'LanguageSpecification' language_name = condition['language'].lower() @@ -94,6 +103,7 @@ class FormatConverter: except Exception: return None + # still need to do size, year, release type else: return None