From 63a75fcda2870cb235f51f4bc721ea48d312d297 Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Mon, 3 Nov 2025 03:02:41 +1030 Subject: [PATCH] feat: better langauge processing for profiles --- CHANGELOG.md | 4 ++++ ops/0.schema.sql | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 740aa40..4ac5e7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,3 +19,7 @@ All schema changes will be documented in this file. universal - quality_profile_custom_formats.arr_type: scores can differ between Radarr and Sonarr + +## 3-11-25 + +- Better profile langauge procesing diff --git a/ops/0.schema.sql b/ops/0.schema.sql index 0c99b33..bcbdaae 100644 --- a/ops/0.schema.sql +++ b/ops/0.schema.sql @@ -71,10 +71,8 @@ CREATE TABLE quality_profiles ( minimum_custom_format_score INTEGER NOT NULL DEFAULT 0, upgrade_until_score INTEGER NOT NULL DEFAULT 0, upgrade_score_increment INTEGER NOT NULL DEFAULT 1 CHECK (upgrade_score_increment > 0), - language_id INTEGER NOT NULL, created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, - updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (language_id) REFERENCES languages(id) + updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP ); -- Conditions define the matching logic for custom formats @@ -123,6 +121,17 @@ CREATE TABLE quality_profile_tags ( FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE ); +-- Link quality profiles to languages with type modifiers +-- Type can be: 'must', 'only', 'not', or 'simple' (default language preference) +CREATE TABLE quality_profile_languages ( + quality_profile_id INTEGER NOT NULL, + language_id INTEGER NOT NULL, + type VARCHAR(20) NOT NULL DEFAULT 'simple', -- 'must', 'only', 'not', 'simple' + PRIMARY KEY (quality_profile_id, language_id), + FOREIGN KEY (quality_profile_id) REFERENCES quality_profiles(id) ON DELETE CASCADE, + FOREIGN KEY (language_id) REFERENCES languages(id) ON DELETE CASCADE +); + -- Define which qualities belong to which quality groups -- All qualities in a group are treated as equivalent CREATE TABLE quality_group_members (