Skip to content

Commit 7024cec

Browse files
committed
Merge Upscale CFs and Rescore
1 parent 3304b3f commit 7024cec

1 file changed

Lines changed: 235 additions & 0 deletions

File tree

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
-- @operation: export
2+
-- @entity: batch
3+
-- @name: Merge Upscale CFs and Rescore
4+
-- @exportedAt: 2026-01-31T19:49:13.980Z
5+
-- @opIds: 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125
6+
7+
-- --- BEGIN op 95 ( update regular_expression "Upscale" )
8+
update "regular_expressions" set "name" = 'Upscale' where "name" = 'Upscaled';
9+
-- --- END op 95
10+
11+
-- --- BEGIN op 96 ( update custom_format "Upscale" )
12+
update "condition_patterns" set "regular_expression_name" = 'Upscale' where "custom_format_name" = 'Upscale' and "condition_name" = 'Upscaled' and "regular_expression_name" = 'Upscaled';
13+
-- --- END op 96
14+
15+
-- --- BEGIN op 97 ( update custom_format "Upscaled" )
16+
update "condition_patterns" set "regular_expression_name" = 'Upscale' where "custom_format_name" = 'Upscaled' and "condition_name" = 'Upscaled' and "regular_expression_name" = 'Upscaled';
17+
-- --- END op 97
18+
19+
-- --- BEGIN op 98 ( update regular_expression "AI Movie Upscale" )
20+
update "regular_expressions" set "name" = 'AI Movie Upscale' where "name" = 'AI Movies';
21+
-- --- END op 98
22+
23+
-- --- BEGIN op 99 ( update custom_format "Upscale" )
24+
update "condition_patterns" set "regular_expression_name" = 'AI Movie Upscale' where "custom_format_name" = 'Upscale' and "condition_name" = 'AI Movies' and "regular_expression_name" = 'AI Movies';
25+
-- --- END op 99
26+
27+
-- --- BEGIN op 100 ( update regular_expression "AI TV Upscale" )
28+
update "regular_expressions" set "name" = 'AI TV Upscale' where "name" = 'AI TV';
29+
-- --- END op 100
30+
31+
-- --- BEGIN op 101 ( update custom_format "Upscaled" )
32+
update "condition_patterns" set "regular_expression_name" = 'AI TV Upscale' where "custom_format_name" = 'Upscaled' and "condition_name" = 'AI TV' and "regular_expression_name" = 'AI TV';
33+
-- --- END op 101
34+
35+
-- --- BEGIN op 102 ( update quality_profile "1080p Balanced" )
36+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '1080p Balanced' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
37+
-- --- END op 102
38+
39+
-- --- BEGIN op 103 ( update quality_profile "1080p Compact" )
40+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '1080p Compact' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
41+
-- --- END op 103
42+
43+
-- --- BEGIN op 104 ( update quality_profile "1080p Efficient" )
44+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '1080p Efficient' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
45+
-- --- END op 104
46+
47+
-- --- BEGIN op 105 ( update quality_profile "1080p Quality" )
48+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '1080p Quality' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
49+
-- --- END op 105
50+
51+
-- --- BEGIN op 106 ( update quality_profile "1080p Quality HDR" )
52+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '1080p Quality HDR' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
53+
-- --- END op 106
54+
55+
-- --- BEGIN op 107 ( update quality_profile "1080p Remux" )
56+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '1080p Remux' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
57+
-- --- END op 107
58+
59+
-- --- BEGIN op 108 ( update quality_profile "2160p Balanced" )
60+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '2160p Balanced' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
61+
-- --- END op 108
62+
63+
-- --- BEGIN op 109 ( update quality_profile "2160p Efficient" )
64+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '2160p Efficient' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
65+
-- --- END op 109
66+
67+
-- --- BEGIN op 110 ( update quality_profile "2160p Quality" )
68+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '2160p Quality' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
69+
-- --- END op 110
70+
71+
-- --- BEGIN op 111 ( update quality_profile "2160p Remux" )
72+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '2160p Remux' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
73+
-- --- END op 111
74+
75+
-- --- BEGIN op 112 ( update quality_profile "720p Quality" )
76+
delete from "quality_profile_custom_formats" where "quality_profile_name" = '720p Quality' and "custom_format_name" = 'Upscaled' and "arr_type" = 'sonarr' and "score" = -999999;
77+
-- --- END op 112
78+
79+
-- --- BEGIN op 113 ( delete custom_format "Upscaled" )
80+
delete from "custom_formats" where "name" = 'Upscaled';
81+
-- --- END op 113
82+
83+
-- --- BEGIN op 114 ( update custom_format "Upscale" )
84+
DELETE FROM custom_format_conditions
85+
WHERE custom_format_name = 'Upscale'
86+
AND name = 'AI Movies'
87+
AND type = 'release_title'
88+
AND arr_type = 'all'
89+
AND negate = 0
90+
AND required = 0;
91+
92+
DELETE FROM custom_format_conditions
93+
WHERE custom_format_name = 'Upscale'
94+
AND name = 'Upscaled'
95+
AND type = 'release_title'
96+
AND arr_type = 'all'
97+
AND negate = 0
98+
AND required = 0;
99+
100+
INSERT INTO custom_format_conditions (custom_format_name, name, type, arr_type, negate, required)
101+
VALUES ('Upscale', 'AI Movies Upscale', 'release_title', 'radarr', 0, 0);
102+
103+
INSERT INTO condition_patterns (custom_format_name, condition_name, regular_expression_name) VALUES ('Upscale', 'AI Movies Upscale', 'AI Movie Upscale');
104+
105+
INSERT INTO custom_format_conditions (custom_format_name, name, type, arr_type, negate, required)
106+
VALUES ('Upscale', 'Upscale', 'release_title', 'all', 0, 0);
107+
108+
INSERT INTO condition_patterns (custom_format_name, condition_name, regular_expression_name) VALUES ('Upscale', 'Upscale', 'Upscale');
109+
110+
INSERT INTO custom_format_conditions (custom_format_name, name, type, arr_type, negate, required)
111+
VALUES ('Upscale', 'AI TV Upscale', 'release_title', 'sonarr', 0, 0);
112+
113+
INSERT INTO condition_patterns (custom_format_name, condition_name, regular_expression_name) VALUES ('Upscale', 'AI TV Upscale', 'AI TV Upscale');
114+
-- --- END op 114
115+
116+
-- --- BEGIN op 115 ( update quality_profile "1080p Balanced" )
117+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
118+
SELECT '1080p Balanced', 'Upscale', 'sonarr', -999999
119+
WHERE NOT EXISTS (
120+
SELECT 1 FROM quality_profile_custom_formats
121+
WHERE quality_profile_name = '1080p Balanced'
122+
AND custom_format_name = 'Upscale'
123+
AND arr_type = 'sonarr'
124+
);
125+
-- --- END op 115
126+
127+
-- --- BEGIN op 116 ( update quality_profile "1080p Compact" )
128+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
129+
SELECT '1080p Compact', 'Upscale', 'sonarr', -999999
130+
WHERE NOT EXISTS (
131+
SELECT 1 FROM quality_profile_custom_formats
132+
WHERE quality_profile_name = '1080p Compact'
133+
AND custom_format_name = 'Upscale'
134+
AND arr_type = 'sonarr'
135+
);
136+
-- --- END op 116
137+
138+
-- --- BEGIN op 117 ( update quality_profile "1080p Efficient" )
139+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
140+
SELECT '1080p Efficient', 'Upscale', 'sonarr', -999999
141+
WHERE NOT EXISTS (
142+
SELECT 1 FROM quality_profile_custom_formats
143+
WHERE quality_profile_name = '1080p Efficient'
144+
AND custom_format_name = 'Upscale'
145+
AND arr_type = 'sonarr'
146+
);
147+
-- --- END op 117
148+
149+
-- --- BEGIN op 118 ( update quality_profile "1080p Quality" )
150+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
151+
SELECT '1080p Quality', 'Upscale', 'sonarr', -999999
152+
WHERE NOT EXISTS (
153+
SELECT 1 FROM quality_profile_custom_formats
154+
WHERE quality_profile_name = '1080p Quality'
155+
AND custom_format_name = 'Upscale'
156+
AND arr_type = 'sonarr'
157+
);
158+
-- --- END op 118
159+
160+
-- --- BEGIN op 119 ( update quality_profile "1080p Quality HDR" )
161+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
162+
SELECT '1080p Quality HDR', 'Upscale', 'sonarr', -999999
163+
WHERE NOT EXISTS (
164+
SELECT 1 FROM quality_profile_custom_formats
165+
WHERE quality_profile_name = '1080p Quality HDR'
166+
AND custom_format_name = 'Upscale'
167+
AND arr_type = 'sonarr'
168+
);
169+
-- --- END op 119
170+
171+
-- --- BEGIN op 120 ( update quality_profile "1080p Remux" )
172+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
173+
SELECT '1080p Remux', 'Upscale', 'sonarr', -999999
174+
WHERE NOT EXISTS (
175+
SELECT 1 FROM quality_profile_custom_formats
176+
WHERE quality_profile_name = '1080p Remux'
177+
AND custom_format_name = 'Upscale'
178+
AND arr_type = 'sonarr'
179+
);
180+
-- --- END op 120
181+
182+
-- --- BEGIN op 121 ( update quality_profile "2160p Balanced" )
183+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
184+
SELECT '2160p Balanced', 'Upscale', 'sonarr', -999999
185+
WHERE NOT EXISTS (
186+
SELECT 1 FROM quality_profile_custom_formats
187+
WHERE quality_profile_name = '2160p Balanced'
188+
AND custom_format_name = 'Upscale'
189+
AND arr_type = 'sonarr'
190+
);
191+
-- --- END op 121
192+
193+
-- --- BEGIN op 122 ( update quality_profile "2160p Efficient" )
194+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
195+
SELECT '2160p Efficient', 'Upscale', 'sonarr', -999999
196+
WHERE NOT EXISTS (
197+
SELECT 1 FROM quality_profile_custom_formats
198+
WHERE quality_profile_name = '2160p Efficient'
199+
AND custom_format_name = 'Upscale'
200+
AND arr_type = 'sonarr'
201+
);
202+
-- --- END op 122
203+
204+
-- --- BEGIN op 123 ( update quality_profile "2160p Quality" )
205+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
206+
SELECT '2160p Quality', 'Upscale', 'sonarr', -999999
207+
WHERE NOT EXISTS (
208+
SELECT 1 FROM quality_profile_custom_formats
209+
WHERE quality_profile_name = '2160p Quality'
210+
AND custom_format_name = 'Upscale'
211+
AND arr_type = 'sonarr'
212+
);
213+
-- --- END op 123
214+
215+
-- --- BEGIN op 124 ( update quality_profile "2160p Remux" )
216+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
217+
SELECT '2160p Remux', 'Upscale', 'sonarr', -999999
218+
WHERE NOT EXISTS (
219+
SELECT 1 FROM quality_profile_custom_formats
220+
WHERE quality_profile_name = '2160p Remux'
221+
AND custom_format_name = 'Upscale'
222+
AND arr_type = 'sonarr'
223+
);
224+
-- --- END op 124
225+
226+
-- --- BEGIN op 125 ( update quality_profile "720p Quality" )
227+
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
228+
SELECT '720p Quality', 'Upscale', 'sonarr', -999999
229+
WHERE NOT EXISTS (
230+
SELECT 1 FROM quality_profile_custom_formats
231+
WHERE quality_profile_name = '720p Quality'
232+
AND custom_format_name = 'Upscale'
233+
AND arr_type = 'sonarr'
234+
);
235+
-- --- END op 125

0 commit comments

Comments
 (0)