From 5b658a564e2ee1132f9f33a73987a039b9318415 Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Tue, 14 Jan 2025 05:59:42 +1030 Subject: [PATCH] feat: add Quality_Modifiers class for Radarr quality mappings and retrieval method --- backend/app/compile/mappings.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/app/compile/mappings.py b/backend/app/compile/mappings.py index 7644c67..18f6480 100644 --- a/backend/app/compile/mappings.py +++ b/backend/app/compile/mappings.py @@ -66,6 +66,18 @@ class Sources: } +class Quality_Modifiers: + """Quality modifier mappings for Radarr ONLY""" + RADARR = { + 'none': 0, + 'regional': 1, + 'screener': 2, + 'rawhd': 3, + 'brdisk': 4, + 'remux': 5, + } + + class Qualities: """Quality mappings for both applications""" COMMON_RESOLUTIONS = { @@ -927,6 +939,10 @@ class ValueResolver: """Maps quality names between different formats based on target app""" return QualityNameMapper.map_quality_name(name, target_app) + @classmethod + def get_quality_modifier(cls, quality_modifier: str) -> int: + return Quality_Modifiers.RADARR.get(quality_modifier.lower(), 0) + @classmethod def get_language(cls, language_name: str,