feat: add arr_type support for radarr/sonarr differentiation

This commit is contained in:
Sam Chau
2025-10-31 23:57:33 +10:30
parent e57097a780
commit c2ca607471
2 changed files with 20 additions and 14 deletions
+6 -2
View File
@@ -9,9 +9,13 @@ All schema changes will be documented in this file.
- Core entity tables: quality_profiles, custom_formats, regular_expressions,
languages, tags, qualities, quality_groups
- Custom format conditions system with 11 condition types (patterns, language,
indexer_flag, source, resolution, quality_modifier, size, release_type,
year)
indexer_flag, source, resolution, quality_modifier, size, release_type, year)
- Quality profile system supporting individual qualities and quality groups
- Junction tables for tags, quality groups, profile qualities, and profile
custom formats
- Unique index ensuring single upgrade_until per profile
- Add arr_type support for Radarr/Sonarr differentiation
- custom_format_conditions.arr_type: conditions can be arr-specific or
universal
- quality_profile_custom_formats.arr_type: scores can differ between Radarr
and Sonarr
+7 -5
View File
@@ -83,9 +83,10 @@ CREATE TABLE custom_format_conditions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
custom_format_id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
type VARCHAR(50) NOT NULL, -- release_title, release_group, edition, language, etc.
negate INTEGER NOT NULL DEFAULT 0, -- Invert the match (e.g., "NOT language")
required INTEGER NOT NULL DEFAULT 0, -- Condition must match for format to apply
type VARCHAR(50) NOT NULL,
arr_type VARCHAR(20) NOT NULL, -- 'radarr', 'sonarr', 'all'
negate INTEGER NOT NULL DEFAULT 0,
required INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (custom_format_id) REFERENCES custom_formats(id) ON DELETE CASCADE
@@ -152,8 +153,9 @@ CREATE TABLE quality_profile_qualities (
CREATE TABLE quality_profile_custom_formats (
quality_profile_id INTEGER NOT NULL,
custom_format_id INTEGER NOT NULL,
score INTEGER NOT NULL, -- Positive scores prefer, negative scores reject
PRIMARY KEY (quality_profile_id, custom_format_id),
arr_type VARCHAR(20) NOT NULL, -- 'radarr', 'sonarr', 'all',
score INTEGER NOT NULL,
PRIMARY KEY (quality_profile_id, custom_format_id, arr_type),
FOREIGN KEY (quality_profile_id) REFERENCES quality_profiles(id) ON DELETE CASCADE,
FOREIGN KEY (custom_format_id) REFERENCES custom_formats(id) ON DELETE CASCADE
);