-- @operation: export
-- @entity: batch
-- @name: Create 1080p and 2160p Streaming Profile / All Blurays Stripped Except Balanced Tiers / WEB Only Profile
-- @exportedAt: 2026-03-22T17:27:54.910Z
-- @opIds: 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3093, 3094, 3095, 3096, 3097, 3098, 3099, 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 3127, 3128, 3129, 3130, 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3138, 3139, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 3242, 3243, 3244, 3245, 3246, 3247, 3248, 3249, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3260, 3261, 3262, 3263, 3264, 3265, 3266, 3267, 3268, 3269, 3270, 3271, 3272, 3273, 3274, 3275, 3276, 3277, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3330, 3331, 3332, 3333, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347, 3348, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 3427, 3428, 3429, 3430, 3431, 3432, 3433, 3434, 3435, 3436, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3444, 3445, 3446, 3447, 3448, 3449, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3466, 3467, 3468, 3469, 3470, 3471, 3472, 3473, 3474, 3475, 3476, 3477, 3478, 3479, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 3487, 3488, 3489, 3490, 3491, 3492, 3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 3527, 3528, 3529, 3530, 3531, 3532, 3533, 3534, 3535, 3536, 3537, 3538, 3539, 3540, 3541, 3542, 3543, 3544, 3545, 3546, 3547, 3548, 3549, 3550, 3551, 3552, 3553, 3554, 3555, 3556, 3557, 3558, 3559, 3560, 3561, 3562, 3563, 3564, 3565, 3566, 3567, 3568, 3569, 3570, 3571, 3572, 3573, 3574, 3575, 3576, 3577, 3578, 3579, 3580, 3581, 3582

-- --- BEGIN op 3067 ( create quality_profile "1080p Streaming" )
insert into "quality_profiles" ("name", "description", "upgrades_allowed", "minimum_custom_format_score", "upgrade_until_score", "upgrade_score_increment") values ('1080p Streaming', '1080p Balanced targets consistent & immutable 1080p **WEB-DLs** using the Streaming Source and Audio Formats to determine the level of Transparency.

- Average Movie Sizes ~ 4 to 8gb per Movie
- Movie Quality Ranking ~ 6/10
- Average TV Sizes ~ 2 to 4gb per Episode
- TV Quality Ranking ~ 7/10', 1, 0, 0, 1);

insert into "tags" ("name") values ('1080p') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('1080p Streaming', '1080p');

insert into "tags" ("name") values ('Balanced Focused') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('1080p Streaming', 'Balanced Focused');

insert into "tags" ("name") values ('Lossy Audio') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('1080p Streaming', 'Lossy Audio');

insert into "tags" ("name") values ('h264') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('1080p Streaming', 'h264');

insert into "tags" ("name") values ('x264') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('1080p Streaming', 'x264');

INSERT INTO quality_groups (quality_profile_name, name) VALUES ('1080p Streaming', 'WEB 1080p');

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'WEB 1080p', 'WEBDL-1080p', 0);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'WEB 1080p', 'WEBRip-1080p', 1);

INSERT INTO quality_groups (quality_profile_name, name) VALUES ('1080p Streaming', 'Pre-releases');

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Pre-releases', 'REGIONAL', 0);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Pre-releases', 'DVDSCR', 1);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Pre-releases', 'TELECINE', 2);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Pre-releases', 'TELESYNC', 3);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Pre-releases', 'CAM', 4);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Pre-releases', 'WORKPRINT', 5);

INSERT INTO quality_groups (quality_profile_name, name) VALUES ('1080p Streaming', 'Unwanted');

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Unwanted', 'Unknown', 0);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Unwanted', 'Raw-HD', 1);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('1080p Streaming', 'Unwanted', 'BR-DISK', 2);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'Remux-2160p', NULL, 1, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'Bluray-2160p', NULL, 2, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'WEBDL-2160p', NULL, 3, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'WEBRip-2160p', NULL, 4, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'HDTV-2160p', NULL, 5, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'Remux-1080p', NULL, 6, 1, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'Bluray-1080p', NULL, 7, 1, 1);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', NULL, 'WEB 1080p', 8, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'HDTV-1080p', NULL, 9, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'Bluray-720p', NULL, 10, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'WEBDL-720p', NULL, 11, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'WEBRip-720p', NULL, 12, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'HDTV-720p', NULL, 13, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'Bluray-576p', NULL, 14, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'Bluray-480p', NULL, 15, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'WEBDL-480p', NULL, 16, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'WEBRip-480p', NULL, 17, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'HDTV-480p', NULL, 18, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'DVD-R', NULL, 19, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'DVD', NULL, 20, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', 'SDTV', NULL, 21, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', NULL, 'Pre-releases', 22, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('1080p Streaming', NULL, 'Unwanted', 23, 0, 0);

INSERT INTO quality_profile_languages (quality_profile_name, language_name, type) VALUES ('1080p Streaming', 'Any', 'simple');
-- --- END op 3067

-- --- BEGIN op 3068 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-1080p'
  AND quality_group_name IS NULL
  AND position = 7
  AND enabled = 1
  AND upgrade_until = 1;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'WEB 1080p'
  AND quality_name IS NULL
  AND position = 8
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'WEB 1080p'
  AND quality_name = 'WEBDL-1080p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'WEB 1080p'
  AND quality_name = 'WEBRip-1080p';

DELETE FROM quality_groups
WHERE quality_profile_name = '1080p Streaming'
  AND name = 'WEB 1080p';

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'HDTV-1080p'
  AND quality_group_name IS NULL
  AND position = 9
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-720p'
  AND quality_group_name IS NULL
  AND position = 10
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WEBDL-720p'
  AND quality_group_name IS NULL
  AND position = 11
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WEBRip-720p'
  AND quality_group_name IS NULL
  AND position = 12
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'HDTV-720p'
  AND quality_group_name IS NULL
  AND position = 13
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-576p'
  AND quality_group_name IS NULL
  AND position = 14
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-480p'
  AND quality_group_name IS NULL
  AND position = 15
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WEBDL-480p'
  AND quality_group_name IS NULL
  AND position = 16
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVD'
  AND quality_group_name IS NULL
  AND position = 20
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'SDTV'
  AND quality_group_name IS NULL
  AND position = 21
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name IS NULL
  AND position = 22
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'CAM';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'DVDSCR';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'REGIONAL';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'TELECINE';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'TELESYNC';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'WORKPRINT';

DELETE FROM quality_groups
WHERE quality_profile_name = '1080p Streaming'
  AND name = 'Pre-releases';

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name IS NULL
  AND position = 23
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name = 'BR-DISK';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name = 'Raw-HD';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name = 'Unknown';

DELETE FROM quality_groups
WHERE quality_profile_name = '1080p Streaming'
  AND name = 'Unwanted';

INSERT INTO quality_groups (quality_profile_name, name)
SELECT '1080p Streaming', '1080p Balanced'
WHERE NOT EXISTS (
  SELECT 1 FROM quality_groups
  WHERE quality_profile_name = '1080p Streaming'
    AND name = '1080p Balanced'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'Bluray-1080p', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'Bluray-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'WEBDL-1080p', 1
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'WEBDL-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'Bluray-720p', 2
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'Bluray-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'WEBDL-720p', 3
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'WEBDL-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'WEBRip-720p', 4
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'WEBRip-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'Bluray-576p', 5
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'Bluray-576p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'Bluray-480p', 6
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'Bluray-480p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'WEBDL-480p', 7
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'WEBDL-480p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'DVD', 8
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'DVD'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'HDTV-1080p', 9
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'HDTV-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'HDTV-720p', 10
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'HDTV-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Balanced', 'SDTV', 11
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Balanced'
    AND quality_name = 'SDTV'
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', NULL, '1080p Balanced', 0, 1, 1
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name IS NULL
    AND quality_group_name = '1080p Balanced'
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'WEBRip-1080p', NULL, 7, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'WEBRip-1080p'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'BR-DISK', NULL, 10, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'BR-DISK'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'CAM', NULL, 11, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'CAM'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'DVDSCR', NULL, 13, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'DVDSCR'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'Raw-HD', NULL, 14, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'Raw-HD'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'REGIONAL', NULL, 15, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'REGIONAL'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'TELECINE', NULL, 16, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'TELECINE'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'TELESYNC', NULL, 17, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'TELESYNC'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'WORKPRINT', NULL, 18, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'WORKPRINT'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'Unknown', NULL, 19, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'Unknown'
    AND quality_group_name IS NULL
);

UPDATE quality_profile_qualities
SET enabled = 0
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Remux-1080p'
  AND quality_group_name IS NULL
  AND position = 6
  AND enabled = 1
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 8
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WEBRip-480p'
  AND quality_group_name IS NULL
  AND position = 17
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 9
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'HDTV-480p'
  AND quality_group_name IS NULL
  AND position = 18
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 12
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVD-R'
  AND quality_group_name IS NULL
  AND position = 19
  AND enabled = 0
  AND upgrade_until = 0;
-- --- END op 3068

-- --- BEGIN op 3069 ( update quality_profile "1080p Streaming" )
update "quality_profiles" set "minimum_custom_format_score" = 200000 where "name" = '1080p Streaming' and "minimum_custom_format_score" = 0;
-- --- END op 3069

-- --- BEGIN op 3070 ( update quality_profile "1080p Streaming" )
update "quality_profiles" set "upgrade_until_score" = 1000000 where "name" = '1080p Streaming' and "upgrade_until_score" = 0;
-- --- END op 3070

-- --- BEGIN op 3071 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p Balanced Tier 1', 'radarr', 861000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p Balanced Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3071

-- --- BEGIN op 3072 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p Balanced Tier 1', 'sonarr', 861000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p Balanced Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3072

-- --- BEGIN op 3073 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p Balanced Tier 2', 'radarr', 860000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p Balanced Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3073

-- --- BEGIN op 3074 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p Balanced Tier 2', 'sonarr', 860000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p Balanced Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3074

-- --- BEGIN op 3075 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV', 'radarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV'
    AND arr_type = 'radarr'
);
-- --- END op 3075

-- --- BEGIN op 3076 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV', 'sonarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV'
    AND arr_type = 'sonarr'
);
-- --- END op 3076

-- --- BEGIN op 3077 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV Tier 1', 'radarr', 42000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3077

-- --- BEGIN op 3078 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV Tier 1', 'sonarr', 42000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3078

-- --- BEGIN op 3079 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV Tier 2', 'radarr', 41000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3079

-- --- BEGIN op 3080 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV Tier 2', 'sonarr', 41000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3080

-- --- BEGIN op 3081 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV Tier 3', 'radarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3081

-- --- BEGIN op 3082 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p HDTV Tier 3', 'sonarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p HDTV Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3082

-- --- BEGIN op 3083 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p WEB-DL', 'radarr', 860000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3083

-- --- BEGIN op 3084 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '1080p WEB-DL', 'sonarr', 860000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '1080p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3084

-- --- BEGIN op 3085 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '3D', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '3D'
    AND arr_type = 'radarr'
);
-- --- END op 3085

-- --- BEGIN op 3086 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Bluray', 'radarr', 320000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3086

-- --- BEGIN op 3087 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Bluray', 'sonarr', 320000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3087

-- --- BEGIN op 3088 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 1', 'radarr', 83000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3088

-- --- BEGIN op 3089 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 1', 'sonarr', 83000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3089

-- --- BEGIN op 3090 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 2', 'radarr', 82000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3090

-- --- BEGIN op 3091 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 2', 'sonarr', 82000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3091

-- --- BEGIN op 3092 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 3', 'radarr', 81000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3092

-- --- BEGIN op 3093 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 3', 'sonarr', 81000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3093

-- --- BEGIN op 3094 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 4', 'radarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 4'
    AND arr_type = 'radarr'
);
-- --- END op 3094

-- --- BEGIN op 3095 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p Quality Tier 4', 'sonarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p Quality Tier 4'
    AND arr_type = 'sonarr'
);
-- --- END op 3095

-- --- BEGIN op 3096 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p WEB-DL', 'radarr', 280000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3096

-- --- BEGIN op 3097 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '480p WEB-DL', 'sonarr', 280000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '480p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3097

-- --- BEGIN op 3098 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Bluray', 'radarr', 420000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3098

-- --- BEGIN op 3099 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Bluray', 'sonarr', 420000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3099

-- --- BEGIN op 3100 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 1', 'radarr', 103000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3100

-- --- BEGIN op 3101 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 1', 'sonarr', 103000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3101

-- --- BEGIN op 3102 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 2', 'radarr', 102000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3102

-- --- BEGIN op 3103 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 2', 'sonarr', 102000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3103

-- --- BEGIN op 3104 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 3', 'radarr', 101000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3104

-- --- BEGIN op 3105 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 3', 'sonarr', 101000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3105

-- --- BEGIN op 3106 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 4', 'radarr', 100000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 4'
    AND arr_type = 'radarr'
);
-- --- END op 3106

-- --- BEGIN op 3107 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p Quality Tier 4', 'sonarr', 100000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p Quality Tier 4'
    AND arr_type = 'sonarr'
);
-- --- END op 3107

-- --- BEGIN op 3108 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p WEB-DL', 'radarr', 300000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3108

-- --- BEGIN op 3109 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '576p WEB-DL', 'sonarr', 300000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '576p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3109

-- --- BEGIN op 3110 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Balanced Tier 1', 'radarr', 120000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Balanced Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3110

-- --- BEGIN op 3111 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Balanced Tier 1', 'sonarr', 120000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Balanced Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3111

-- --- BEGIN op 3112 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Bluray', 'radarr', 540000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3112

-- --- BEGIN op 3113 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Bluray', 'sonarr', 540000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3113

-- --- BEGIN op 3114 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV', 'radarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV'
    AND arr_type = 'radarr'
);
-- --- END op 3114

-- --- BEGIN op 3115 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV', 'sonarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV'
    AND arr_type = 'sonarr'
);
-- --- END op 3115

-- --- BEGIN op 3116 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV Tier 1', 'radarr', 22000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3116

-- --- BEGIN op 3117 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV Tier 1', 'sonarr', 22000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3117

-- --- BEGIN op 3118 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV Tier 2', 'radarr', 21000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3118

-- --- BEGIN op 3119 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV Tier 2', 'sonarr', 21000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3119

-- --- BEGIN op 3120 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV Tier 3', 'radarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3120

-- --- BEGIN op 3121 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p HDTV Tier 3', 'sonarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p HDTV Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3121

-- --- BEGIN op 3122 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 1', 'all', 85000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 1'
    AND arr_type = 'all'
);
-- --- END op 3122

-- --- BEGIN op 3123 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 1', 'radarr', 145000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3123

-- --- BEGIN op 3124 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 1', 'sonarr', 145000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3124

-- --- BEGIN op 3125 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 2', 'all', 84000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 2'
    AND arr_type = 'all'
);
-- --- END op 3125

-- --- BEGIN op 3126 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 2', 'radarr', 144000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3126

-- --- BEGIN op 3127 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 2', 'sonarr', 144000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3127

-- --- BEGIN op 3128 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 3', 'all', 83000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 3'
    AND arr_type = 'all'
);
-- --- END op 3128

-- --- BEGIN op 3129 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 3', 'radarr', 143000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3129

-- --- BEGIN op 3130 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 3', 'sonarr', 143000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3130

-- --- BEGIN op 3131 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 4', 'all', 82000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 4'
    AND arr_type = 'all'
);
-- --- END op 3131

-- --- BEGIN op 3132 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 4', 'radarr', 142000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 4'
    AND arr_type = 'radarr'
);
-- --- END op 3132

-- --- BEGIN op 3133 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 4', 'sonarr', 142000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 4'
    AND arr_type = 'sonarr'
);
-- --- END op 3133

-- --- BEGIN op 3134 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 5', 'all', 81000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 5'
    AND arr_type = 'all'
);
-- --- END op 3134

-- --- BEGIN op 3135 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 5', 'radarr', 141000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 5'
    AND arr_type = 'radarr'
);
-- --- END op 3135

-- --- BEGIN op 3136 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 5', 'sonarr', 141000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 5'
    AND arr_type = 'sonarr'
);
-- --- END op 3136

-- --- BEGIN op 3137 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 6', 'all', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 6'
    AND arr_type = 'all'
);
-- --- END op 3137

-- --- BEGIN op 3138 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 6', 'radarr', 140000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 6'
    AND arr_type = 'radarr'
);
-- --- END op 3138

-- --- BEGIN op 3139 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p Quality Tier 6', 'sonarr', 140000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p Quality Tier 6'
    AND arr_type = 'sonarr'
);
-- --- END op 3139

-- --- BEGIN op 3140 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p WEB-DL', 'radarr', 660000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3140

-- --- BEGIN op 3141 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p WEB-DL', 'sonarr', 660000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3141

-- --- BEGIN op 3142 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', '720p WEBRip', 'radarr', 540000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = '720p WEBRip'
    AND arr_type = 'radarr'
);
-- --- END op 3142

-- --- BEGIN op 3143 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'AAC', 'all', 200
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'AAC'
    AND arr_type = 'all'
);
-- --- END op 3143

-- --- BEGIN op 3144 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'AMZN', 'all', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'AMZN'
    AND arr_type = 'all'
);
-- --- END op 3144

-- --- BEGIN op 3145 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'ASL', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'ASL'
    AND arr_type = 'all'
);
-- --- END op 3145

-- --- BEGIN op 3146 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'ATVP', 'all', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'ATVP'
    AND arr_type = 'all'
);
-- --- END op 3146

-- --- BEGIN op 3147 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'AV1', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'AV1'
    AND arr_type = 'all'
);
-- --- END op 3147

-- --- BEGIN op 3148 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'B&W', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'B&W'
    AND arr_type = 'radarr'
);
-- --- END op 3148

-- --- BEGIN op 3149 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'BCORE', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'BCORE'
    AND arr_type = 'all'
);
-- --- END op 3149

-- --- BEGIN op 3150 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Banned Groups', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Banned Groups'
    AND arr_type = 'all'
);
-- --- END op 3150

-- --- BEGIN op 3151 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Banned WEBRip', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Banned WEBRip'
    AND arr_type = 'all'
);
-- --- END op 3151

-- --- BEGIN op 3152 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Better Theatricals', 'radarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Better Theatricals'
    AND arr_type = 'radarr'
);
-- --- END op 3152

-- --- BEGIN op 3153 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'CRAV', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'CRAV'
    AND arr_type = 'all'
);
-- --- END op 3153

-- --- BEGIN op 3154 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'CRIT', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'CRIT'
    AND arr_type = 'all'
);
-- --- END op 3154

-- --- BEGIN op 3155 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DRPO', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DRPO'
    AND arr_type = 'all'
);
-- --- END op 3155

-- --- BEGIN op 3156 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DSNP', 'radarr', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DSNP'
    AND arr_type = 'radarr'
);
-- --- END op 3156

-- --- BEGIN op 3157 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DSNP', 'sonarr', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DSNP'
    AND arr_type = 'sonarr'
);
-- --- END op 3157

-- --- BEGIN op 3158 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DTS', 'all', 300
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DTS'
    AND arr_type = 'all'
);
-- --- END op 3158

-- --- BEGIN op 3159 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DTS-ES', 'all', 500
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DTS-ES'
    AND arr_type = 'all'
);
-- --- END op 3159

-- --- BEGIN op 3160 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DTS-HD HRA', 'all', 700
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DTS-HD HRA'
    AND arr_type = 'all'
);
-- --- END op 3160

-- --- BEGIN op 3161 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD', 'radarr', 200000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD'
    AND arr_type = 'radarr'
);
-- --- END op 3161

-- --- BEGIN op 3162 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD', 'sonarr', 200000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD'
    AND arr_type = 'sonarr'
);
-- --- END op 3162

-- --- BEGIN op 3163 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD Quality Tier 1', 'radarr', 61000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3163

-- --- BEGIN op 3164 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD Quality Tier 1', 'sonarr', 61000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3164

-- --- BEGIN op 3165 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD Quality Tier 2', 'radarr', 60000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3165

-- --- BEGIN op 3166 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD Quality Tier 2', 'sonarr', 60000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3166

-- --- BEGIN op 3167 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD Remux', 'radarr', 220000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD Remux'
    AND arr_type = 'radarr'
);
-- --- END op 3167

-- --- BEGIN op 3168 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'DVD Remux', 'sonarr', 220000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'DVD Remux'
    AND arr_type = 'sonarr'
);
-- --- END op 3168

-- --- BEGIN op 3169 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Dolby Atmos', 'all', 400
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Dolby Atmos'
    AND arr_type = 'all'
);
-- --- END op 3169

-- --- BEGIN op 3170 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Dolby Digital', 'all', 400
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Dolby Digital'
    AND arr_type = 'all'
);
-- --- END op 3170

-- --- BEGIN op 3171 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Dolby Digital +', 'all', 600
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Dolby Digital +'
    AND arr_type = 'all'
);
-- --- END op 3171

-- --- BEGIN op 3172 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Dolby Vision', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Dolby Vision'
    AND arr_type = 'all'
);
-- --- END op 3172

-- --- BEGIN op 3173 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Extended Edition', 'radarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Extended Edition'
    AND arr_type = 'radarr'
);
-- --- END op 3173

-- --- BEGIN op 3174 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Extras', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Extras'
    AND arr_type = 'radarr'
);
-- --- END op 3174

-- --- BEGIN op 3175 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Extras', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Extras'
    AND arr_type = 'sonarr'
);
-- --- END op 3175

-- --- BEGIN op 3176 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'FLAC', 'all', 800
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'FLAC'
    AND arr_type = 'all'
);
-- --- END op 3176

-- --- BEGIN op 3177 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Full Disc', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Full Disc'
    AND arr_type = 'all'
);
-- --- END op 3177

-- --- BEGIN op 3178 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Full Disc (Quality Match)', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Full Disc (Quality Match)'
    AND arr_type = 'radarr'
);
-- --- END op 3178

-- --- BEGIN op 3179 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'German DL', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'German DL'
    AND arr_type = 'radarr'
);
-- --- END op 3179

-- --- BEGIN op 3180 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'German DL', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'German DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3180

-- --- BEGIN op 3181 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'HDR', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'HDR'
    AND arr_type = 'all'
);
-- --- END op 3181

-- --- BEGIN op 3182 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'HDR10', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'HDR10'
    AND arr_type = 'all'
);
-- --- END op 3182

-- --- BEGIN op 3183 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'HDR10+', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'HDR10+'
    AND arr_type = 'all'
);
-- --- END op 3183

-- --- BEGIN op 3184 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'HLG', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'HLG'
    AND arr_type = 'all'
);
-- --- END op 3184

-- --- BEGIN op 3185 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'HMAX', 'all', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'HMAX'
    AND arr_type = 'all'
);
-- --- END op 3185

-- --- BEGIN op 3186 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'HTSR', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'HTSR'
    AND arr_type = 'all'
);
-- --- END op 3186

-- --- BEGIN op 3187 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'HULU', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'HULU'
    AND arr_type = 'all'
);
-- --- END op 3187

-- --- BEGIN op 3188 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'MA', 'radarr', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'MA'
    AND arr_type = 'radarr'
);
-- --- END op 3188

-- --- BEGIN op 3189 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'MAX', 'all', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'MAX'
    AND arr_type = 'all'
);
-- --- END op 3189

-- --- BEGIN op 3190 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'MUBI', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'MUBI'
    AND arr_type = 'all'
);
-- --- END op 3190

-- --- BEGIN op 3191 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'NF', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'NF'
    AND arr_type = 'all'
);
-- --- END op 3191

-- --- BEGIN op 3192 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'NOW', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'NOW'
    AND arr_type = 'all'
);
-- --- END op 3192

-- --- BEGIN op 3193 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Not Original or English', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Not Original or English'
    AND arr_type = 'radarr'
);
-- --- END op 3193

-- --- BEGIN op 3194 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Not Original or English', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Not Original or English'
    AND arr_type = 'sonarr'
);
-- --- END op 3194

-- --- BEGIN op 3195 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Opus', 'all', 700
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Opus'
    AND arr_type = 'all'
);
-- --- END op 3195

-- --- BEGIN op 3196 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'PCOK', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'PCOK'
    AND arr_type = 'all'
);
-- --- END op 3196

-- --- BEGIN op 3197 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'PLAY', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'PLAY'
    AND arr_type = 'all'
);
-- --- END op 3197

-- --- BEGIN op 3198 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'PMTP', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'PMTP'
    AND arr_type = 'all'
);
-- --- END op 3198

-- --- BEGIN op 3199 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'PQ', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'PQ'
    AND arr_type = 'all'
);
-- --- END op 3199

-- --- BEGIN op 3200 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'ROKU', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'ROKU'
    AND arr_type = 'all'
);
-- --- END op 3200

-- --- BEGIN op 3201 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Release Group (Missing)', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Release Group (Missing)'
    AND arr_type = 'radarr'
);
-- --- END op 3201

-- --- BEGIN op 3202 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Release Group (Missing)', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Release Group (Missing)'
    AND arr_type = 'sonarr'
);
-- --- END op 3202

-- --- BEGIN op 3203 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Remux', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Remux'
    AND arr_type = 'all'
);
-- --- END op 3203

-- --- BEGIN op 3204 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Repack1', 'all', 6
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Repack1'
    AND arr_type = 'all'
);
-- --- END op 3204

-- --- BEGIN op 3205 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Repack2', 'all', 7
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Repack2'
    AND arr_type = 'all'
);
-- --- END op 3205

-- --- BEGIN op 3206 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Repack3', 'all', 8
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Repack3'
    AND arr_type = 'all'
);
-- --- END op 3206

-- --- BEGIN op 3207 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'SDTV', 'radarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'SDTV'
    AND arr_type = 'radarr'
);
-- --- END op 3207

-- --- BEGIN op 3208 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'SDTV', 'sonarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'SDTV'
    AND arr_type = 'sonarr'
);
-- --- END op 3208

-- --- BEGIN op 3209 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'SDTV Tier 1', 'radarr', 10000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'SDTV Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3209

-- --- BEGIN op 3210 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'SDTV Tier 1', 'sonarr', 10000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'SDTV Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3210

-- --- BEGIN op 3211 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'SHO', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'SHO'
    AND arr_type = 'all'
);
-- --- END op 3211

-- --- BEGIN op 3212 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'STAN', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'STAN'
    AND arr_type = 'all'
);
-- --- END op 3212

-- --- BEGIN op 3213 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Season Pack', 'sonarr', 10
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Season Pack'
    AND arr_type = 'sonarr'
);
-- --- END op 3213

-- --- BEGIN op 3214 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Sing Along', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Sing Along'
    AND arr_type = 'radarr'
);
-- --- END op 3214

-- --- BEGIN op 3215 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Special Edition', 'radarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Special Edition'
    AND arr_type = 'radarr'
);
-- --- END op 3215

-- --- BEGIN op 3216 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Upscale', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Upscale'
    AND arr_type = 'radarr'
);
-- --- END op 3216

-- --- BEGIN op 3217 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Upscale', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Upscale'
    AND arr_type = 'sonarr'
);
-- --- END op 3217

-- --- BEGIN op 3218 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'VP9', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'VP9'
    AND arr_type = 'all'
);
-- --- END op 3218

-- --- BEGIN op 3219 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'VVC', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'VVC'
    AND arr_type = 'all'
);
-- --- END op 3219

-- --- BEGIN op 3220 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'WEB-DL Tier 1', 'all', 100
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'WEB-DL Tier 1'
    AND arr_type = 'all'
);
-- --- END op 3220

-- --- BEGIN op 3221 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'WEB-DL Tier 2', 'all', 80
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'WEB-DL Tier 2'
    AND arr_type = 'all'
);
-- --- END op 3221

-- --- BEGIN op 3222 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'WEB-DL Tier 3', 'all', 60
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'WEB-DL Tier 3'
    AND arr_type = 'all'
);
-- --- END op 3222

-- --- BEGIN op 3223 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'WEB-DL Tier 4', 'all', 40
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'WEB-DL Tier 4'
    AND arr_type = 'all'
);
-- --- END op 3223

-- --- BEGIN op 3224 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'WEB-DL Tier 5', 'all', 20
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'WEB-DL Tier 5'
    AND arr_type = 'all'
);
-- --- END op 3224

-- --- BEGIN op 3225 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'Xvid', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'Xvid'
    AND arr_type = 'all'
);
-- --- END op 3225

-- --- BEGIN op 3226 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'h265', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'h265'
    AND arr_type = 'all'
);
-- --- END op 3226

-- --- BEGIN op 3227 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'iP', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'iP'
    AND arr_type = 'all'
);
-- --- END op 3227

-- --- BEGIN op 3228 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'iT', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'iT'
    AND arr_type = 'all'
);
-- --- END op 3228

-- --- BEGIN op 3229 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '1080p Streaming', 'x265', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '1080p Streaming'
    AND custom_format_name = 'x265'
    AND arr_type = 'all'
);
-- --- END op 3229

-- --- BEGIN op 3230 ( update quality_profile "1080p Streaming" )
update "quality_profiles" set "description" = '1080p Streaming targets consistent & immutable 1080p **WEB-DLs** using the Streaming Source and Audio Formats to determine the level of Transparency.

- Average Movie Sizes ~ 4 to 8gb per Movie
- Movie Quality Ranking ~ 6/10
- Average TV Sizes ~ 2 to 4gb per Episode
- TV Quality Ranking ~ 7/10' where "name" = '1080p Streaming' and "description" = '1080p Balanced targets consistent & immutable 1080p **WEB-DLs** using the Streaming Source and Audio Formats to determine the level of Transparency.

- Average Movie Sizes ~ 4 to 8gb per Movie
- Movie Quality Ranking ~ 6/10
- Average TV Sizes ~ 2 to 4gb per Episode
- TV Quality Ranking ~ 7/10';
-- --- END op 3230

-- --- BEGIN op 3231 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name IS NULL
  AND position = 0
  AND enabled = 1
  AND upgrade_until = 1;

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'Bluray-1080p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'Bluray-480p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'Bluray-576p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'Bluray-720p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'DVD';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'HDTV-1080p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'HDTV-720p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'SDTV';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'WEBDL-1080p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'WEBDL-480p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'WEBDL-720p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Balanced'
  AND quality_name = 'WEBRip-720p';

DELETE FROM quality_groups
WHERE quality_profile_name = '1080p Streaming'
  AND name = '1080p Balanced';

INSERT INTO quality_groups (quality_profile_name, name)
SELECT '1080p Streaming', '1080p Streaming'
WHERE NOT EXISTS (
  SELECT 1 FROM quality_groups
  WHERE quality_profile_name = '1080p Streaming'
    AND name = '1080p Streaming'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'Bluray-1080p', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'Bluray-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'WEBDL-1080p', 1
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'WEBDL-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'WEBDL-720p', 2
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'WEBDL-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'WEBRip-720p', 3
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'WEBRip-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'WEBDL-480p', 4
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'WEBDL-480p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'DVD', 5
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'DVD'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'HDTV-1080p', 6
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'HDTV-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'HDTV-720p', 7
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'HDTV-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '1080p Streaming', '1080p Streaming', 'SDTV', 8
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_group_name = '1080p Streaming'
    AND quality_name = 'SDTV'
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', NULL, '1080p Streaming', 0, 1, 1
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name IS NULL
    AND quality_group_name = '1080p Streaming'
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'Bluray-720p', NULL, 8, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'Bluray-720p'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'Bluray-576p', NULL, 9, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'Bluray-576p'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'Bluray-480p', NULL, 10, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'Bluray-480p'
    AND quality_group_name IS NULL
);

UPDATE quality_profile_qualities
SET position = 11
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WEBRip-480p'
  AND quality_group_name IS NULL
  AND position = 8
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 12
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'HDTV-480p'
  AND quality_group_name IS NULL
  AND position = 9
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 13
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'BR-DISK'
  AND quality_group_name IS NULL
  AND position = 10
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 14
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'CAM'
  AND quality_group_name IS NULL
  AND position = 11
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 15
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVD-R'
  AND quality_group_name IS NULL
  AND position = 12
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 16
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVDSCR'
  AND quality_group_name IS NULL
  AND position = 13
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 17
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Raw-HD'
  AND quality_group_name IS NULL
  AND position = 14
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 18
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'REGIONAL'
  AND quality_group_name IS NULL
  AND position = 15
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 19
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'TELECINE'
  AND quality_group_name IS NULL
  AND position = 16
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 20
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'TELESYNC'
  AND quality_group_name IS NULL
  AND position = 17
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 21
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WORKPRINT'
  AND quality_group_name IS NULL
  AND position = 18
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 22
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Unknown'
  AND quality_group_name IS NULL
  AND position = 19
  AND enabled = 0
  AND upgrade_until = 0;
-- --- END op 3231

-- --- BEGIN op 3232 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '1080p WEB-DL'
  AND arr_type = 'radarr'
  AND score = 860000;
-- --- END op 3232

-- --- BEGIN op 3233 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '1080p WEB-DL'
  AND arr_type = 'sonarr'
  AND score = 860000;
-- --- END op 3233

-- --- BEGIN op 3234 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Bluray'
  AND arr_type = 'radarr'
  AND score = 320000;
-- --- END op 3234

-- --- BEGIN op 3235 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Bluray'
  AND arr_type = 'sonarr'
  AND score = 320000;
-- --- END op 3235

-- --- BEGIN op 3236 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Bluray'
  AND arr_type = 'radarr'
  AND score = 420000;
-- --- END op 3236

-- --- BEGIN op 3237 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Bluray'
  AND arr_type = 'sonarr'
  AND score = 420000;
-- --- END op 3237

-- --- BEGIN op 3238 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Bluray'
  AND arr_type = 'radarr'
  AND score = 540000;
-- --- END op 3238

-- --- BEGIN op 3239 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Bluray'
  AND arr_type = 'sonarr'
  AND score = 540000;
-- --- END op 3239

-- --- BEGIN op 3240 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p WEB-DL'
  AND arr_type = 'radarr'
  AND score = 660000;
-- --- END op 3240

-- --- BEGIN op 3241 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p WEB-DL'
  AND arr_type = 'sonarr'
  AND score = 660000;
-- --- END op 3241

-- --- BEGIN op 3242 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p WEBRip'
  AND arr_type = 'radarr'
  AND score = 540000;
-- --- END op 3242

-- --- BEGIN op 3243 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 1'
  AND arr_type = 'all'
  AND score = 85000;
-- --- END op 3243

-- --- BEGIN op 3244 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 2'
  AND arr_type = 'all'
  AND score = 84000;
-- --- END op 3244

-- --- BEGIN op 3245 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 3'
  AND arr_type = 'all'
  AND score = 83000;
-- --- END op 3245

-- --- BEGIN op 3246 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 4'
  AND arr_type = 'all'
  AND score = 82000;
-- --- END op 3246

-- --- BEGIN op 3247 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 5'
  AND arr_type = 'all'
  AND score = 81000;
-- --- END op 3247

-- --- BEGIN op 3248 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 6'
  AND arr_type = 'all'
  AND score = 80000;
-- --- END op 3248

-- --- BEGIN op 3249 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 1'
  AND arr_type = 'radarr'
  AND score = 83000;
-- --- END op 3249

-- --- BEGIN op 3250 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 1'
  AND arr_type = 'sonarr'
  AND score = 83000;
-- --- END op 3250

-- --- BEGIN op 3251 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 2'
  AND arr_type = 'radarr'
  AND score = 82000;
-- --- END op 3251

-- --- BEGIN op 3252 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 2'
  AND arr_type = 'sonarr'
  AND score = 82000;
-- --- END op 3252

-- --- BEGIN op 3253 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 3'
  AND arr_type = 'radarr'
  AND score = 81000;
-- --- END op 3253

-- --- BEGIN op 3254 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 3'
  AND arr_type = 'sonarr'
  AND score = 81000;
-- --- END op 3254

-- --- BEGIN op 3255 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 4'
  AND arr_type = 'radarr'
  AND score = 80000;
-- --- END op 3255

-- --- BEGIN op 3256 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '480p Quality Tier 4'
  AND arr_type = 'sonarr'
  AND score = 80000;
-- --- END op 3256

-- --- BEGIN op 3257 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 1'
  AND arr_type = 'radarr'
  AND score = 103000;
-- --- END op 3257

-- --- BEGIN op 3258 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 1'
  AND arr_type = 'sonarr'
  AND score = 103000;
-- --- END op 3258

-- --- BEGIN op 3259 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 2'
  AND arr_type = 'radarr'
  AND score = 102000;
-- --- END op 3259

-- --- BEGIN op 3260 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 2'
  AND arr_type = 'sonarr'
  AND score = 102000;
-- --- END op 3260

-- --- BEGIN op 3261 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 3'
  AND arr_type = 'radarr'
  AND score = 101000;
-- --- END op 3261

-- --- BEGIN op 3262 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 3'
  AND arr_type = 'sonarr'
  AND score = 101000;
-- --- END op 3262

-- --- BEGIN op 3263 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 4'
  AND arr_type = 'radarr'
  AND score = 100000;
-- --- END op 3263

-- --- BEGIN op 3264 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '576p Quality Tier 4'
  AND arr_type = 'sonarr'
  AND score = 100000;
-- --- END op 3264

-- --- BEGIN op 3265 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 1'
  AND arr_type = 'radarr'
  AND score = 145000;
-- --- END op 3265

-- --- BEGIN op 3266 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 1'
  AND arr_type = 'sonarr'
  AND score = 145000;
-- --- END op 3266

-- --- BEGIN op 3267 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 2'
  AND arr_type = 'radarr'
  AND score = 144000;
-- --- END op 3267

-- --- BEGIN op 3268 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 2'
  AND arr_type = 'sonarr'
  AND score = 144000;
-- --- END op 3268

-- --- BEGIN op 3269 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 3'
  AND arr_type = 'radarr'
  AND score = 143000;
-- --- END op 3269

-- --- BEGIN op 3270 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 3'
  AND arr_type = 'sonarr'
  AND score = 143000;
-- --- END op 3270

-- --- BEGIN op 3271 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 4'
  AND arr_type = 'radarr'
  AND score = 142000;
-- --- END op 3271

-- --- BEGIN op 3272 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 4'
  AND arr_type = 'sonarr'
  AND score = 142000;
-- --- END op 3272

-- --- BEGIN op 3273 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 5'
  AND arr_type = 'radarr'
  AND score = 141000;
-- --- END op 3273

-- --- BEGIN op 3274 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 5'
  AND arr_type = 'sonarr'
  AND score = 141000;
-- --- END op 3274

-- --- BEGIN op 3275 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 6'
  AND arr_type = 'radarr'
  AND score = 140000;
-- --- END op 3275

-- --- BEGIN op 3276 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Quality Tier 6'
  AND arr_type = 'sonarr'
  AND score = 140000;
-- --- END op 3276

-- --- BEGIN op 3277 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 341000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '1080p Balanced Tier 1'
  AND arr_type = 'radarr'
  AND score = 861000;
-- --- END op 3277

-- --- BEGIN op 3278 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 341000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '1080p Balanced Tier 1'
  AND arr_type = 'sonarr'
  AND score = 861000;
-- --- END op 3278

-- --- BEGIN op 3279 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '1080p Balanced Tier 2'
  AND arr_type = 'radarr'
  AND score = 860000;
-- --- END op 3279

-- --- BEGIN op 3280 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '1080p Balanced Tier 2'
  AND arr_type = 'sonarr'
  AND score = 860000;
-- --- END op 3280

-- --- BEGIN op 3281 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Balanced Tier 1'
  AND arr_type = 'radarr'
  AND score = 120000;
-- --- END op 3281

-- --- BEGIN op 3282 ( update quality_profile "1080p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '1080p Streaming'
  AND custom_format_name = '720p Balanced Tier 1'
  AND arr_type = 'sonarr'
  AND score = 120000;
-- --- END op 3282

-- --- BEGIN op 3283 ( update quality_profile "1080p Streaming" )
DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-720p'
  AND quality_group_name IS NULL
  AND position = 8
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 8
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-576p'
  AND quality_group_name IS NULL
  AND position = 9
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 9
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-480p'
  AND quality_group_name IS NULL
  AND position = 10
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 10
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WEBRip-480p'
  AND quality_group_name IS NULL
  AND position = 11
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 11
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'HDTV-480p'
  AND quality_group_name IS NULL
  AND position = 12
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 12
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'BR-DISK'
  AND quality_group_name IS NULL
  AND position = 13
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 13
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'CAM'
  AND quality_group_name IS NULL
  AND position = 14
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 14
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVD-R'
  AND quality_group_name IS NULL
  AND position = 15
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 15
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVDSCR'
  AND quality_group_name IS NULL
  AND position = 16
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 16
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Raw-HD'
  AND quality_group_name IS NULL
  AND position = 17
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 17
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'REGIONAL'
  AND quality_group_name IS NULL
  AND position = 18
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 18
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'TELECINE'
  AND quality_group_name IS NULL
  AND position = 19
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 19
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'TELESYNC'
  AND quality_group_name IS NULL
  AND position = 20
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 20
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WORKPRINT'
  AND quality_group_name IS NULL
  AND position = 21
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 21
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Unknown'
  AND quality_group_name IS NULL
  AND position = 22
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
  AND (SELECT COUNT(*)
FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming') = 9
  AND NOT EXISTS (
    SELECT 1
    FROM quality_group_members
    WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
      AND quality_name NOT IN ('Bluray-1080p', 'WEBDL-1080p', 'WEBDL-720p', 'WEBRip-720p', 'WEBDL-480p', 'DVD', 'HDTV-1080p', 'HDTV-720p', 'SDTV')
  )
  AND (
    NOT EXISTS (
      SELECT 1
      FROM quality_group_members
      WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
        AND NOT (
          (quality_name = 'Bluray-1080p'
        AND position = 0)
      OR (quality_name = 'WEBDL-1080p'
        AND position = 1)
      OR (quality_name = 'WEBDL-720p'
        AND position = 2)
      OR (quality_name = 'WEBRip-720p'
        AND position = 3)
      OR (quality_name = 'WEBDL-480p'
        AND position = 4)
      OR (quality_name = 'DVD'
        AND position = 5)
      OR (quality_name = 'HDTV-1080p'
        AND position = 6)
      OR (quality_name = 'HDTV-720p'
        AND position = 7)
      OR (quality_name = 'SDTV'
        AND position = 8)
        )
    )
    OR NOT EXISTS (
      SELECT 1
      FROM quality_group_members
      WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
        AND position != 0
    )
  );

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
WITH can_insert AS (
  SELECT (
    SELECT COUNT(*)
    FROM quality_group_members
    WHERE quality_profile_name = '1080p Streaming'
      AND quality_group_name = '1080p Streaming'
  ) = 0 AS ok
),
new_rows AS (
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'Bluray-1080p' AS quality_name, 0 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'WEBDL-1080p' AS quality_name, 1 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'Bluray-720p' AS quality_name, 2 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'WEBDL-720p' AS quality_name, 3 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'WEBRip-720p' AS quality_name, 4 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'WEBDL-480p' AS quality_name, 5 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'DVD' AS quality_name, 6 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'HDTV-1080p' AS quality_name, 7 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'HDTV-720p' AS quality_name, 8 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'SDTV' AS quality_name, 9 AS position
)
SELECT
  new_rows.quality_profile_name,
  new_rows.quality_group_name,
  new_rows.quality_name,
  new_rows.position
FROM new_rows
CROSS JOIN can_insert
WHERE ok;
-- --- END op 3283

-- --- BEGIN op 3284 ( create quality_profile "2160p Streaming" )
insert into "quality_profiles" ("name", "description", "upgrades_allowed", "minimum_custom_format_score", "upgrade_until_score", "upgrade_score_increment") values ('2160p Streaming', '2160p Balanced targets consistent & immutable 2160p **WEB-DLs w/ Lossy Audio**. 

- Average Movie Sizes ~ 15 to 30gb per Movie
- Movie Quality Ranking ~ 8/10
- Average TV Sizes ~ 5 to 15gb per Episode
- TV Quality Ranking ~ 8/10', 1, 0, 0, 1);

insert into "tags" ("name") values ('2160p') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('2160p Streaming', '2160p');

insert into "tags" ("name") values ('Balanced Focused') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('2160p Streaming', 'Balanced Focused');

insert into "tags" ("name") values ('HDR') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('2160p Streaming', 'HDR');

insert into "tags" ("name") values ('Lossy Audio') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('2160p Streaming', 'Lossy Audio');

insert into "tags" ("name") values ('h265') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('2160p Streaming', 'h265');

insert into "tags" ("name") values ('x264') on conflict ("name") do nothing;

INSERT INTO quality_profile_tags (quality_profile_name, tag_name) VALUES ('2160p Streaming', 'x264');

INSERT INTO quality_groups (quality_profile_name, name) VALUES ('2160p Streaming', 'WEB 1080p');

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'WEB 1080p', 'WEBDL-1080p', 0);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'WEB 1080p', 'WEBRip-1080p', 1);

INSERT INTO quality_groups (quality_profile_name, name) VALUES ('2160p Streaming', 'Pre-releases');

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Pre-releases', 'REGIONAL', 0);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Pre-releases', 'DVDSCR', 1);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Pre-releases', 'TELECINE', 2);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Pre-releases', 'TELESYNC', 3);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Pre-releases', 'CAM', 4);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Pre-releases', 'WORKPRINT', 5);

INSERT INTO quality_groups (quality_profile_name, name) VALUES ('2160p Streaming', 'Unwanted');

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Unwanted', 'Unknown', 0);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Unwanted', 'Raw-HD', 1);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position) VALUES ('2160p Streaming', 'Unwanted', 'BR-DISK', 2);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'Remux-2160p', NULL, 1, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'Bluray-2160p', NULL, 2, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'WEBDL-2160p', NULL, 3, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'WEBRip-2160p', NULL, 4, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'HDTV-2160p', NULL, 5, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'Remux-1080p', NULL, 6, 1, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'Bluray-1080p', NULL, 7, 1, 1);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', NULL, 'WEB 1080p', 8, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'HDTV-1080p', NULL, 9, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'Bluray-720p', NULL, 10, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'WEBDL-720p', NULL, 11, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'WEBRip-720p', NULL, 12, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'HDTV-720p', NULL, 13, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'Bluray-576p', NULL, 14, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'Bluray-480p', NULL, 15, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'WEBDL-480p', NULL, 16, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'WEBRip-480p', NULL, 17, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'HDTV-480p', NULL, 18, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'DVD-R', NULL, 19, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'DVD', NULL, 20, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', 'SDTV', NULL, 21, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', NULL, 'Pre-releases', 22, 0, 0);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until) VALUES ('2160p Streaming', NULL, 'Unwanted', 23, 0, 0);

INSERT INTO quality_profile_languages (quality_profile_name, language_name, type) VALUES ('2160p Streaming', 'Any', 'simple');
-- --- END op 3284

-- --- BEGIN op 3285 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Bluray-2160p'
  AND quality_group_name IS NULL
  AND position = 2
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WEBDL-2160p'
  AND quality_group_name IS NULL
  AND position = 3
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Bluray-1080p'
  AND quality_group_name IS NULL
  AND position = 7
  AND enabled = 1
  AND upgrade_until = 1;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'WEB 1080p'
  AND quality_name IS NULL
  AND position = 8
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'WEB 1080p'
  AND quality_name = 'WEBDL-1080p';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'WEB 1080p'
  AND quality_name = 'WEBRip-1080p';

DELETE FROM quality_groups
WHERE quality_profile_name = '2160p Streaming'
  AND name = 'WEB 1080p';

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'HDTV-1080p'
  AND quality_group_name IS NULL
  AND position = 9
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Bluray-720p'
  AND quality_group_name IS NULL
  AND position = 10
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WEBDL-720p'
  AND quality_group_name IS NULL
  AND position = 11
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WEBRip-720p'
  AND quality_group_name IS NULL
  AND position = 12
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'HDTV-720p'
  AND quality_group_name IS NULL
  AND position = 13
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Bluray-576p'
  AND quality_group_name IS NULL
  AND position = 14
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Bluray-480p'
  AND quality_group_name IS NULL
  AND position = 15
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WEBDL-480p'
  AND quality_group_name IS NULL
  AND position = 16
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'DVD'
  AND quality_group_name IS NULL
  AND position = 20
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'SDTV'
  AND quality_group_name IS NULL
  AND position = 21
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name IS NULL
  AND position = 22
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'CAM';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'DVDSCR';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'REGIONAL';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'TELECINE';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'TELESYNC';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Pre-releases'
  AND quality_name = 'WORKPRINT';

DELETE FROM quality_groups
WHERE quality_profile_name = '2160p Streaming'
  AND name = 'Pre-releases';

DELETE FROM quality_profile_qualities
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name IS NULL
  AND position = 23
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name = 'BR-DISK';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name = 'Raw-HD';

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = 'Unwanted'
  AND quality_name = 'Unknown';

DELETE FROM quality_groups
WHERE quality_profile_name = '2160p Streaming'
  AND name = 'Unwanted';

INSERT INTO quality_groups (quality_profile_name, name)
SELECT '2160p Streaming', '2160p Balanced'
WHERE NOT EXISTS (
  SELECT 1 FROM quality_groups
  WHERE quality_profile_name = '2160p Streaming'
    AND name = '2160p Balanced'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'Bluray-2160p', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'Bluray-2160p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'WEBDL-2160p', 1
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'WEBDL-2160p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'Bluray-1080p', 2
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'Bluray-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'WEBDL-1080p', 3
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'WEBDL-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'WEBRip-1080p', 4
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'WEBRip-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'Bluray-720p', 5
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'Bluray-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'WEBDL-720p', 6
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'WEBDL-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'WEBRip-720p', 7
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'WEBRip-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'Bluray-576p', 8
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'Bluray-576p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'Bluray-480p', 9
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'Bluray-480p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'WEBDL-480p', 10
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'WEBDL-480p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'DVD', 11
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'DVD'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'HDTV-1080p', 12
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'HDTV-1080p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'HDTV-720p', 13
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'HDTV-720p'
);

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
SELECT '2160p Streaming', '2160p Balanced', 'SDTV', 14
WHERE NOT EXISTS (
  SELECT 1 FROM quality_group_members
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_group_name = '2160p Balanced'
    AND quality_name = 'SDTV'
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', NULL, '2160p Balanced', 0, 1, 1
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name IS NULL
    AND quality_group_name = '2160p Balanced'
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'BR-DISK', NULL, 7, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'BR-DISK'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'CAM', NULL, 8, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'CAM'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'DVDSCR', NULL, 10, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'DVDSCR'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'Raw-HD', NULL, 11, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'Raw-HD'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'REGIONAL', NULL, 12, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'REGIONAL'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'TELECINE', NULL, 13, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'TELECINE'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'TELESYNC', NULL, 14, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'TELESYNC'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'WORKPRINT', NULL, 15, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'WORKPRINT'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'Unknown', NULL, 16, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'Unknown'
    AND quality_group_name IS NULL
);

UPDATE quality_profile_qualities
SET position = 2
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WEBRip-2160p'
  AND quality_group_name IS NULL
  AND position = 4
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 3
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'HDTV-2160p'
  AND quality_group_name IS NULL
  AND position = 5
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 4, enabled = 0
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Remux-1080p'
  AND quality_group_name IS NULL
  AND position = 6
  AND enabled = 1
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 5
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WEBRip-480p'
  AND quality_group_name IS NULL
  AND position = 17
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 6
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'HDTV-480p'
  AND quality_group_name IS NULL
  AND position = 18
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 9
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'DVD-R'
  AND quality_group_name IS NULL
  AND position = 19
  AND enabled = 0
  AND upgrade_until = 0;
-- --- END op 3285

-- --- BEGIN op 3286 ( update quality_profile "2160p Streaming" )
update "quality_profiles" set "minimum_custom_format_score" = 200000 where "name" = '2160p Streaming' and "minimum_custom_format_score" = 0;
-- --- END op 3286

-- --- BEGIN op 3287 ( update quality_profile "2160p Streaming" )
update "quality_profiles" set "upgrade_until_score" = 1000000 where "name" = '2160p Streaming' and "upgrade_until_score" = 0;
-- --- END op 3287

-- --- BEGIN op 3288 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Balanced Tier 1', 'radarr', 161000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Balanced Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3288

-- --- BEGIN op 3289 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Balanced Tier 1', 'sonarr', 161000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Balanced Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3289

-- --- BEGIN op 3290 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Balanced Tier 2', 'radarr', 160000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Balanced Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3290

-- --- BEGIN op 3291 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Balanced Tier 2', 'sonarr', 160000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Balanced Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3291

-- --- BEGIN op 3292 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Bluray', 'radarr', 700000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3292

-- --- BEGIN op 3293 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Bluray', 'sonarr', 700000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3293

-- --- BEGIN op 3294 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV', 'radarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV'
    AND arr_type = 'radarr'
);
-- --- END op 3294

-- --- BEGIN op 3295 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV', 'sonarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV'
    AND arr_type = 'sonarr'
);
-- --- END op 3295

-- --- BEGIN op 3296 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV Tier 1', 'radarr', 42000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3296

-- --- BEGIN op 3297 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV Tier 1', 'sonarr', 42000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3297

-- --- BEGIN op 3298 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV Tier 2', 'radarr', 41000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3298

-- --- BEGIN op 3299 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV Tier 2', 'sonarr', 41000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3299

-- --- BEGIN op 3300 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV Tier 3', 'radarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3300

-- --- BEGIN op 3301 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p HDTV Tier 3', 'sonarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p HDTV Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3301

-- --- BEGIN op 3302 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 1', 'all', 125000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 1'
    AND arr_type = 'all'
);
-- --- END op 3302

-- --- BEGIN op 3303 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 1', 'radarr', 185000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3303

-- --- BEGIN op 3304 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 1', 'sonarr', 185000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3304

-- --- BEGIN op 3305 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 2', 'all', 124000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 2'
    AND arr_type = 'all'
);
-- --- END op 3305

-- --- BEGIN op 3306 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 2', 'radarr', 184000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3306

-- --- BEGIN op 3307 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 2', 'sonarr', 184000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3307

-- --- BEGIN op 3308 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 3', 'all', 123000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 3'
    AND arr_type = 'all'
);
-- --- END op 3308

-- --- BEGIN op 3309 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 3', 'radarr', 183000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3309

-- --- BEGIN op 3310 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 3', 'sonarr', 183000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3310

-- --- BEGIN op 3311 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 4', 'all', 122000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 4'
    AND arr_type = 'all'
);
-- --- END op 3311

-- --- BEGIN op 3312 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 4', 'radarr', 182000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 4'
    AND arr_type = 'radarr'
);
-- --- END op 3312

-- --- BEGIN op 3313 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 4', 'sonarr', 182000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 4'
    AND arr_type = 'sonarr'
);
-- --- END op 3313

-- --- BEGIN op 3314 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 5', 'all', 121000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 5'
    AND arr_type = 'all'
);
-- --- END op 3314

-- --- BEGIN op 3315 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 5', 'radarr', 181000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 5'
    AND arr_type = 'radarr'
);
-- --- END op 3315

-- --- BEGIN op 3316 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 5', 'sonarr', 181000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 5'
    AND arr_type = 'sonarr'
);
-- --- END op 3316

-- --- BEGIN op 3317 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 6', 'all', 120000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 6'
    AND arr_type = 'all'
);
-- --- END op 3317

-- --- BEGIN op 3318 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 6', 'radarr', 180000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 6'
    AND arr_type = 'radarr'
);
-- --- END op 3318

-- --- BEGIN op 3319 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p Quality Tier 6', 'sonarr', 180000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p Quality Tier 6'
    AND arr_type = 'sonarr'
);
-- --- END op 3319

-- --- BEGIN op 3320 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p WEB-DL', 'radarr', 860000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3320

-- --- BEGIN op 3321 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p WEB-DL', 'sonarr', 860000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3321

-- --- BEGIN op 3322 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '1080p WEBRip', 'radarr', 700000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '1080p WEBRip'
    AND arr_type = 'radarr'
);
-- --- END op 3322

-- --- BEGIN op 3323 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p Balanced Tier 1', 'radarr', 922000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p Balanced Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3323

-- --- BEGIN op 3324 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p Balanced Tier 1', 'sonarr', 924000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p Balanced Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3324

-- --- BEGIN op 3325 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p Balanced Tier 2', 'radarr', 921000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p Balanced Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3325

-- --- BEGIN op 3326 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p Balanced Tier 2', 'sonarr', 921000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p Balanced Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3326

-- --- BEGIN op 3327 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p Balanced Tier 3', 'radarr', 920000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p Balanced Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3327

-- --- BEGIN op 3328 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p Balanced Tier 3', 'sonarr', 920000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p Balanced Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3328

-- --- BEGIN op 3329 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p WEB-DL', 'radarr', 920000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3329

-- --- BEGIN op 3330 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '2160p WEB-DL', 'sonarr', 920000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '2160p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3330

-- --- BEGIN op 3331 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '3D', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '3D'
    AND arr_type = 'radarr'
);
-- --- END op 3331

-- --- BEGIN op 3332 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Bluray', 'radarr', 320000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3332

-- --- BEGIN op 3333 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Bluray', 'sonarr', 320000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3333

-- --- BEGIN op 3334 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 1', 'radarr', 83000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3334

-- --- BEGIN op 3335 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 1', 'sonarr', 83000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3335

-- --- BEGIN op 3336 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 2', 'radarr', 82000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3336

-- --- BEGIN op 3337 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 2', 'sonarr', 82000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3337

-- --- BEGIN op 3338 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 3', 'radarr', 81000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3338

-- --- BEGIN op 3339 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 3', 'sonarr', 81000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3339

-- --- BEGIN op 3340 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 4', 'radarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 4'
    AND arr_type = 'radarr'
);
-- --- END op 3340

-- --- BEGIN op 3341 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p Quality Tier 4', 'sonarr', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p Quality Tier 4'
    AND arr_type = 'sonarr'
);
-- --- END op 3341

-- --- BEGIN op 3342 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p WEB-DL', 'radarr', 280000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3342

-- --- BEGIN op 3343 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '480p WEB-DL', 'sonarr', 280000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '480p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3343

-- --- BEGIN op 3344 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Bluray', 'radarr', 420000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3344

-- --- BEGIN op 3345 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Bluray', 'sonarr', 420000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3345

-- --- BEGIN op 3346 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 1', 'radarr', 103000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3346

-- --- BEGIN op 3347 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 1', 'sonarr', 103000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3347

-- --- BEGIN op 3348 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 2', 'radarr', 102000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3348

-- --- BEGIN op 3349 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 2', 'sonarr', 102000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3349

-- --- BEGIN op 3350 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 3', 'radarr', 101000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3350

-- --- BEGIN op 3351 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 3', 'sonarr', 101000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3351

-- --- BEGIN op 3352 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 4', 'radarr', 100000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 4'
    AND arr_type = 'radarr'
);
-- --- END op 3352

-- --- BEGIN op 3353 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p Quality Tier 4', 'sonarr', 100000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p Quality Tier 4'
    AND arr_type = 'sonarr'
);
-- --- END op 3353

-- --- BEGIN op 3354 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p WEB-DL', 'radarr', 300000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3354

-- --- BEGIN op 3355 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '576p WEB-DL', 'sonarr', 300000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '576p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3355

-- --- BEGIN op 3356 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Balanced Tier 1', 'radarr', 120000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Balanced Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3356

-- --- BEGIN op 3357 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Balanced Tier 1', 'sonarr', 120000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Balanced Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3357

-- --- BEGIN op 3358 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Bluray', 'radarr', 540000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3358

-- --- BEGIN op 3359 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Bluray', 'sonarr', 540000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3359

-- --- BEGIN op 3360 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV', 'radarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV'
    AND arr_type = 'radarr'
);
-- --- END op 3360

-- --- BEGIN op 3361 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV', 'sonarr', 40000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV'
    AND arr_type = 'sonarr'
);
-- --- END op 3361

-- --- BEGIN op 3362 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV Tier 1', 'radarr', 22000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3362

-- --- BEGIN op 3363 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV Tier 1', 'sonarr', 22000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3363

-- --- BEGIN op 3364 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV Tier 2', 'radarr', 21000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3364

-- --- BEGIN op 3365 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV Tier 2', 'sonarr', 21000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3365

-- --- BEGIN op 3366 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV Tier 3', 'radarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3366

-- --- BEGIN op 3367 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p HDTV Tier 3', 'sonarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p HDTV Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3367

-- --- BEGIN op 3368 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 1', 'all', 85000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 1'
    AND arr_type = 'all'
);
-- --- END op 3368

-- --- BEGIN op 3369 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 1', 'radarr', 145000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3369

-- --- BEGIN op 3370 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 1', 'sonarr', 145000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3370

-- --- BEGIN op 3371 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 2', 'all', 84000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 2'
    AND arr_type = 'all'
);
-- --- END op 3371

-- --- BEGIN op 3372 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 2', 'radarr', 144000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3372

-- --- BEGIN op 3373 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 2', 'sonarr', 144000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3373

-- --- BEGIN op 3374 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 3', 'all', 83000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 3'
    AND arr_type = 'all'
);
-- --- END op 3374

-- --- BEGIN op 3375 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 3', 'radarr', 143000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 3'
    AND arr_type = 'radarr'
);
-- --- END op 3375

-- --- BEGIN op 3376 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 3', 'sonarr', 143000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 3'
    AND arr_type = 'sonarr'
);
-- --- END op 3376

-- --- BEGIN op 3377 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 4', 'all', 82000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 4'
    AND arr_type = 'all'
);
-- --- END op 3377

-- --- BEGIN op 3378 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 4', 'radarr', 142000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 4'
    AND arr_type = 'radarr'
);
-- --- END op 3378

-- --- BEGIN op 3379 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 4', 'sonarr', 142000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 4'
    AND arr_type = 'sonarr'
);
-- --- END op 3379

-- --- BEGIN op 3380 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 5', 'all', 81000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 5'
    AND arr_type = 'all'
);
-- --- END op 3380

-- --- BEGIN op 3381 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 5', 'radarr', 141000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 5'
    AND arr_type = 'radarr'
);
-- --- END op 3381

-- --- BEGIN op 3382 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 5', 'sonarr', 141000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 5'
    AND arr_type = 'sonarr'
);
-- --- END op 3382

-- --- BEGIN op 3383 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 6', 'all', 80000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 6'
    AND arr_type = 'all'
);
-- --- END op 3383

-- --- BEGIN op 3384 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 6', 'radarr', 140000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 6'
    AND arr_type = 'radarr'
);
-- --- END op 3384

-- --- BEGIN op 3385 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p Quality Tier 6', 'sonarr', 140000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p Quality Tier 6'
    AND arr_type = 'sonarr'
);
-- --- END op 3385

-- --- BEGIN op 3386 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p WEB-DL', 'radarr', 660000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p WEB-DL'
    AND arr_type = 'radarr'
);
-- --- END op 3386

-- --- BEGIN op 3387 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p WEB-DL', 'sonarr', 660000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p WEB-DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3387

-- --- BEGIN op 3388 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', '720p WEBRip', 'radarr', 540000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = '720p WEBRip'
    AND arr_type = 'radarr'
);
-- --- END op 3388

-- --- BEGIN op 3389 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'AAC', 'all', 200
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'AAC'
    AND arr_type = 'all'
);
-- --- END op 3389

-- --- BEGIN op 3390 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'AMZN', 'radarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'AMZN'
    AND arr_type = 'radarr'
);
-- --- END op 3390

-- --- BEGIN op 3391 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'AMZN', 'sonarr', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'AMZN'
    AND arr_type = 'sonarr'
);
-- --- END op 3391

-- --- BEGIN op 3392 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'ASL', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'ASL'
    AND arr_type = 'all'
);
-- --- END op 3392

-- --- BEGIN op 3393 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'ATVP', 'all', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'ATVP'
    AND arr_type = 'all'
);
-- --- END op 3393

-- --- BEGIN op 3394 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'AV1', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'AV1'
    AND arr_type = 'all'
);
-- --- END op 3394

-- --- BEGIN op 3395 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Amazon Enhancement', 'radarr', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Amazon Enhancement'
    AND arr_type = 'radarr'
);
-- --- END op 3395

-- --- BEGIN op 3396 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Amazon Enhancement', 'sonarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Amazon Enhancement'
    AND arr_type = 'sonarr'
);
-- --- END op 3396

-- --- BEGIN op 3397 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Atmos', 'all', 400
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Atmos'
    AND arr_type = 'all'
);
-- --- END op 3397

-- --- BEGIN op 3398 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Atmos (Missing)', 'all', 400
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Atmos (Missing)'
    AND arr_type = 'all'
);
-- --- END op 3398

-- --- BEGIN op 3399 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'B&W', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'B&W'
    AND arr_type = 'radarr'
);
-- --- END op 3399

-- --- BEGIN op 3400 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'BCORE', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'BCORE'
    AND arr_type = 'all'
);
-- --- END op 3400

-- --- BEGIN op 3401 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Banned Groups', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Banned Groups'
    AND arr_type = 'all'
);
-- --- END op 3401

-- --- BEGIN op 3402 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Banned UHD Bluray', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Banned UHD Bluray'
    AND arr_type = 'all'
);
-- --- END op 3402

-- --- BEGIN op 3403 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Banned WEBRip', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Banned WEBRip'
    AND arr_type = 'all'
);
-- --- END op 3403

-- --- BEGIN op 3404 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Better Theatricals', 'radarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Better Theatricals'
    AND arr_type = 'radarr'
);
-- --- END op 3404

-- --- BEGIN op 3405 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'CRAV', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'CRAV'
    AND arr_type = 'all'
);
-- --- END op 3405

-- --- BEGIN op 3406 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'CRIT', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'CRIT'
    AND arr_type = 'all'
);
-- --- END op 3406

-- --- BEGIN op 3407 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DRPO', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DRPO'
    AND arr_type = 'all'
);
-- --- END op 3407

-- --- BEGIN op 3408 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DSNP', 'radarr', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DSNP'
    AND arr_type = 'radarr'
);
-- --- END op 3408

-- --- BEGIN op 3409 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DSNP', 'sonarr', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DSNP'
    AND arr_type = 'sonarr'
);
-- --- END op 3409

-- --- BEGIN op 3410 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DTS', 'all', 300
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DTS'
    AND arr_type = 'all'
);
-- --- END op 3410

-- --- BEGIN op 3411 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DTS-ES', 'all', 500
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DTS-ES'
    AND arr_type = 'all'
);
-- --- END op 3411

-- --- BEGIN op 3412 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DTS-HD HRA', 'all', 700
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DTS-HD HRA'
    AND arr_type = 'all'
);
-- --- END op 3412

-- --- BEGIN op 3413 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DTS-HD MA', 'all', 1200
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DTS-HD MA'
    AND arr_type = 'all'
);
-- --- END op 3413

-- --- BEGIN op 3414 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DTS-X', 'all', 1600
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DTS-X'
    AND arr_type = 'all'
);
-- --- END op 3414

-- --- BEGIN op 3415 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD', 'radarr', 200000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD'
    AND arr_type = 'radarr'
);
-- --- END op 3415

-- --- BEGIN op 3416 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD', 'sonarr', 200000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD'
    AND arr_type = 'sonarr'
);
-- --- END op 3416

-- --- BEGIN op 3417 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD Quality Tier 1', 'radarr', 61000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD Quality Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3417

-- --- BEGIN op 3418 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD Quality Tier 1', 'sonarr', 61000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD Quality Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3418

-- --- BEGIN op 3419 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD Quality Tier 2', 'radarr', 60000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD Quality Tier 2'
    AND arr_type = 'radarr'
);
-- --- END op 3419

-- --- BEGIN op 3420 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD Quality Tier 2', 'sonarr', 60000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD Quality Tier 2'
    AND arr_type = 'sonarr'
);
-- --- END op 3420

-- --- BEGIN op 3421 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD Remux', 'radarr', 220000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD Remux'
    AND arr_type = 'radarr'
);
-- --- END op 3421

-- --- BEGIN op 3422 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'DVD Remux', 'sonarr', 220000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'DVD Remux'
    AND arr_type = 'sonarr'
);
-- --- END op 3422

-- --- BEGIN op 3423 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Disney+ Enhancement', 'radarr', -1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Disney+ Enhancement'
    AND arr_type = 'radarr'
);
-- --- END op 3423

-- --- BEGIN op 3424 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Disney+ Enhancement', 'sonarr', -1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Disney+ Enhancement'
    AND arr_type = 'sonarr'
);
-- --- END op 3424

-- --- BEGIN op 3425 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Dolby Digital', 'all', 400
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Dolby Digital'
    AND arr_type = 'all'
);
-- --- END op 3425

-- --- BEGIN op 3426 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Dolby Digital +', 'all', 600
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Dolby Digital +'
    AND arr_type = 'all'
);
-- --- END op 3426

-- --- BEGIN op 3427 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Dolby Vision', 'all', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Dolby Vision'
    AND arr_type = 'all'
);
-- --- END op 3427

-- --- BEGIN op 3428 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Dolby Vision (Without Fallback)', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Dolby Vision (Without Fallback)'
    AND arr_type = 'all'
);
-- --- END op 3428

-- --- BEGIN op 3429 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Extended Edition', 'radarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Extended Edition'
    AND arr_type = 'radarr'
);
-- --- END op 3429

-- --- BEGIN op 3430 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Extras', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Extras'
    AND arr_type = 'radarr'
);
-- --- END op 3430

-- --- BEGIN op 3431 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Extras', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Extras'
    AND arr_type = 'sonarr'
);
-- --- END op 3431

-- --- BEGIN op 3432 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'FLAC', 'all', 800
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'FLAC'
    AND arr_type = 'all'
);
-- --- END op 3432

-- --- BEGIN op 3433 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Full Disc', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Full Disc'
    AND arr_type = 'all'
);
-- --- END op 3433

-- --- BEGIN op 3434 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Full Disc (Quality Match)', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Full Disc (Quality Match)'
    AND arr_type = 'radarr'
);
-- --- END op 3434

-- --- BEGIN op 3435 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'German DL', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'German DL'
    AND arr_type = 'radarr'
);
-- --- END op 3435

-- --- BEGIN op 3436 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'German DL', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'German DL'
    AND arr_type = 'sonarr'
);
-- --- END op 3436

-- --- BEGIN op 3437 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HBO Max Enhancement', 'sonarr', -1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HBO Max Enhancement'
    AND arr_type = 'sonarr'
);
-- --- END op 3437

-- --- BEGIN op 3438 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HDR', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HDR'
    AND arr_type = 'all'
);
-- --- END op 3438

-- --- BEGIN op 3439 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HDR (Missing)', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HDR (Missing)'
    AND arr_type = 'all'
);
-- --- END op 3439

-- --- BEGIN op 3440 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HDR10', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HDR10'
    AND arr_type = 'all'
);
-- --- END op 3440

-- --- BEGIN op 3441 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HDR10+', 'all', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HDR10+'
    AND arr_type = 'all'
);
-- --- END op 3441

-- --- BEGIN op 3442 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HLG', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HLG'
    AND arr_type = 'all'
);
-- --- END op 3442

-- --- BEGIN op 3443 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HMAX', 'radarr', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HMAX'
    AND arr_type = 'radarr'
);
-- --- END op 3443

-- --- BEGIN op 3444 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HMAX', 'sonarr', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HMAX'
    AND arr_type = 'sonarr'
);
-- --- END op 3444

-- --- BEGIN op 3445 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HTSR', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HTSR'
    AND arr_type = 'all'
);
-- --- END op 3445

-- --- BEGIN op 3446 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'HULU', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'HULU'
    AND arr_type = 'all'
);
-- --- END op 3446

-- --- BEGIN op 3447 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'MA', 'radarr', 5000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'MA'
    AND arr_type = 'radarr'
);
-- --- END op 3447

-- --- BEGIN op 3448 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'MAX', 'radarr', 2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'MAX'
    AND arr_type = 'radarr'
);
-- --- END op 3448

-- --- BEGIN op 3449 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'MAX', 'sonarr', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'MAX'
    AND arr_type = 'sonarr'
);
-- --- END op 3449

-- --- BEGIN op 3450 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'MUBI', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'MUBI'
    AND arr_type = 'all'
);
-- --- END op 3450

-- --- BEGIN op 3451 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Movies Anywhere Enhancement', 'radarr', -2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Movies Anywhere Enhancement'
    AND arr_type = 'radarr'
);
-- --- END op 3451

-- --- BEGIN op 3452 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'NF', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'NF'
    AND arr_type = 'all'
);
-- --- END op 3452

-- --- BEGIN op 3453 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'NOW', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'NOW'
    AND arr_type = 'all'
);
-- --- END op 3453

-- --- BEGIN op 3454 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Not Original or English', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Not Original or English'
    AND arr_type = 'radarr'
);
-- --- END op 3454

-- --- BEGIN op 3455 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Not Original or English', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Not Original or English'
    AND arr_type = 'sonarr'
);
-- --- END op 3455

-- --- BEGIN op 3456 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Opus', 'all', 700
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Opus'
    AND arr_type = 'all'
);
-- --- END op 3456

-- --- BEGIN op 3457 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'PCM', 'all', 800
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'PCM'
    AND arr_type = 'all'
);
-- --- END op 3457

-- --- BEGIN op 3458 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'PCOK', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'PCOK'
    AND arr_type = 'all'
);
-- --- END op 3458

-- --- BEGIN op 3459 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'PLAY', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'PLAY'
    AND arr_type = 'all'
);
-- --- END op 3459

-- --- BEGIN op 3460 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'PMTP', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'PMTP'
    AND arr_type = 'all'
);
-- --- END op 3460

-- --- BEGIN op 3461 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'PQ', 'all', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'PQ'
    AND arr_type = 'all'
);
-- --- END op 3461

-- --- BEGIN op 3462 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'ROKU', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'ROKU'
    AND arr_type = 'all'
);
-- --- END op 3462

-- --- BEGIN op 3463 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Release Group (Missing)', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Release Group (Missing)'
    AND arr_type = 'radarr'
);
-- --- END op 3463

-- --- BEGIN op 3464 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Release Group (Missing)', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Release Group (Missing)'
    AND arr_type = 'sonarr'
);
-- --- END op 3464

-- --- BEGIN op 3465 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Remux', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Remux'
    AND arr_type = 'all'
);
-- --- END op 3465

-- --- BEGIN op 3466 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Repack1', 'all', 6
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Repack1'
    AND arr_type = 'all'
);
-- --- END op 3466

-- --- BEGIN op 3467 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Repack2', 'all', 7
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Repack2'
    AND arr_type = 'all'
);
-- --- END op 3467

-- --- BEGIN op 3468 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Repack3', 'all', 8
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Repack3'
    AND arr_type = 'all'
);
-- --- END op 3468

-- --- BEGIN op 3469 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'SDTV', 'radarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'SDTV'
    AND arr_type = 'radarr'
);
-- --- END op 3469

-- --- BEGIN op 3470 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'SDTV', 'sonarr', 20000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'SDTV'
    AND arr_type = 'sonarr'
);
-- --- END op 3470

-- --- BEGIN op 3471 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'SDTV Tier 1', 'radarr', 10000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'SDTV Tier 1'
    AND arr_type = 'radarr'
);
-- --- END op 3471

-- --- BEGIN op 3472 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'SDTV Tier 1', 'sonarr', 10000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'SDTV Tier 1'
    AND arr_type = 'sonarr'
);
-- --- END op 3472

-- --- BEGIN op 3473 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'SHO', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'SHO'
    AND arr_type = 'all'
);
-- --- END op 3473

-- --- BEGIN op 3474 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'STAN', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'STAN'
    AND arr_type = 'all'
);
-- --- END op 3474

-- --- BEGIN op 3475 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Season Pack', 'sonarr', 10
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Season Pack'
    AND arr_type = 'sonarr'
);
-- --- END op 3475

-- --- BEGIN op 3476 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Sing Along', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Sing Along'
    AND arr_type = 'radarr'
);
-- --- END op 3476

-- --- BEGIN op 3477 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Special Edition', 'radarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Special Edition'
    AND arr_type = 'radarr'
);
-- --- END op 3477

-- --- BEGIN op 3478 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'TrueHD', 'all', 1200
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'TrueHD'
    AND arr_type = 'all'
);
-- --- END op 3478

-- --- BEGIN op 3479 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'TrueHD (Missing)', 'all', 1200
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'TrueHD (Missing)'
    AND arr_type = 'all'
);
-- --- END op 3479

-- --- BEGIN op 3480 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'UHD Bluray', 'radarr', 840000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'UHD Bluray'
    AND arr_type = 'radarr'
);
-- --- END op 3480

-- --- BEGIN op 3481 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'UHD Bluray', 'sonarr', 840000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'UHD Bluray'
    AND arr_type = 'sonarr'
);
-- --- END op 3481

-- --- BEGIN op 3482 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Upscale', 'radarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Upscale'
    AND arr_type = 'radarr'
);
-- --- END op 3482

-- --- BEGIN op 3483 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Upscale', 'sonarr', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Upscale'
    AND arr_type = 'sonarr'
);
-- --- END op 3483

-- --- BEGIN op 3484 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'VP9', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'VP9'
    AND arr_type = 'all'
);
-- --- END op 3484

-- --- BEGIN op 3485 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'VVC', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'VVC'
    AND arr_type = 'all'
);
-- --- END op 3485

-- --- BEGIN op 3486 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'WEB-DL Tier 1', 'all', 100
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'WEB-DL Tier 1'
    AND arr_type = 'all'
);
-- --- END op 3486

-- --- BEGIN op 3487 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'WEB-DL Tier 2', 'all', 80
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'WEB-DL Tier 2'
    AND arr_type = 'all'
);
-- --- END op 3487

-- --- BEGIN op 3488 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'WEB-DL Tier 3', 'all', 60
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'WEB-DL Tier 3'
    AND arr_type = 'all'
);
-- --- END op 3488

-- --- BEGIN op 3489 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'WEB-DL Tier 4', 'all', 40
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'WEB-DL Tier 4'
    AND arr_type = 'all'
);
-- --- END op 3489

-- --- BEGIN op 3490 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'WEB-DL Tier 5', 'all', 20
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'WEB-DL Tier 5'
    AND arr_type = 'all'
);
-- --- END op 3490

-- --- BEGIN op 3491 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'Xvid', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'Xvid'
    AND arr_type = 'all'
);
-- --- END op 3491

-- --- BEGIN op 3492 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'h265', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'h265'
    AND arr_type = 'all'
);
-- --- END op 3492

-- --- BEGIN op 3493 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'iP', 'all', 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'iP'
    AND arr_type = 'all'
);
-- --- END op 3493

-- --- BEGIN op 3494 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'iT', 'radarr', 3000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'iT'
    AND arr_type = 'radarr'
);
-- --- END op 3494

-- --- BEGIN op 3495 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'iT', 'sonarr', 1000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'iT'
    AND arr_type = 'sonarr'
);
-- --- END op 3495

-- --- BEGIN op 3496 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'iTunes Enhancement', 'radarr', -2000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'iTunes Enhancement'
    AND arr_type = 'radarr'
);
-- --- END op 3496

-- --- BEGIN op 3497 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'x264 (2160p)', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'x264 (2160p)'
    AND arr_type = 'all'
);
-- --- END op 3497

-- --- BEGIN op 3498 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'x265 (Bluray)', 'radarr', -820000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'x265 (Bluray)'
    AND arr_type = 'radarr'
);
-- --- END op 3498

-- --- BEGIN op 3499 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'x265 (Bluray)', 'sonarr', -820000
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'x265 (Bluray)'
    AND arr_type = 'sonarr'
);
-- --- END op 3499

-- --- BEGIN op 3500 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_custom_formats (quality_profile_name, custom_format_name, arr_type, score)
SELECT '2160p Streaming', 'x265 (WEB)', 'all', -999999
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_custom_formats
  WHERE quality_profile_name = '2160p Streaming'
    AND custom_format_name = 'x265 (WEB)'
    AND arr_type = 'all'
);
-- --- END op 3500

-- --- BEGIN op 3501 ( update quality_profile "2160p Streaming" )
INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'WEBRip-1080p', NULL, 5, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'WEBRip-1080p'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'WEBRip-720p', NULL, 6, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'WEBRip-720p'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'Bluray-576p', NULL, 7, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'Bluray-576p'
    AND quality_group_name IS NULL
);

INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '2160p Streaming', 'Bluray-480p', NULL, 8, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '2160p Streaming'
    AND quality_name = 'Bluray-480p'
    AND quality_group_name IS NULL
);

UPDATE quality_profile_qualities
SET position = 9
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WEBRip-480p'
  AND quality_group_name IS NULL
  AND position = 5
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 10
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'HDTV-480p'
  AND quality_group_name IS NULL
  AND position = 6
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 11
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'BR-DISK'
  AND quality_group_name IS NULL
  AND position = 7
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 12
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'CAM'
  AND quality_group_name IS NULL
  AND position = 8
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 13
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'DVD-R'
  AND quality_group_name IS NULL
  AND position = 9
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 14
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'DVDSCR'
  AND quality_group_name IS NULL
  AND position = 10
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 15
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Raw-HD'
  AND quality_group_name IS NULL
  AND position = 11
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 16
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'REGIONAL'
  AND quality_group_name IS NULL
  AND position = 12
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 17
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'TELECINE'
  AND quality_group_name IS NULL
  AND position = 13
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 18
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'TELESYNC'
  AND quality_group_name IS NULL
  AND position = 14
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 19
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'WORKPRINT'
  AND quality_group_name IS NULL
  AND position = 15
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 20
WHERE quality_profile_name = '2160p Streaming'
  AND quality_name = 'Unknown'
  AND quality_group_name IS NULL
  AND position = 16
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = '2160p Balanced'
  AND (SELECT COUNT(*)
FROM quality_group_members
WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = '2160p Balanced') = 15
  AND NOT EXISTS (
    SELECT 1
    FROM quality_group_members
    WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = '2160p Balanced'
      AND quality_name NOT IN ('Bluray-2160p', 'WEBDL-2160p', 'Bluray-1080p', 'WEBDL-1080p', 'WEBRip-1080p', 'Bluray-720p', 'WEBDL-720p', 'WEBRip-720p', 'Bluray-576p', 'Bluray-480p', 'WEBDL-480p', 'DVD', 'HDTV-1080p', 'HDTV-720p', 'SDTV')
  )
  AND (
    NOT EXISTS (
      SELECT 1
      FROM quality_group_members
      WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = '2160p Balanced'
        AND NOT (
          (quality_name = 'Bluray-2160p'
        AND position = 0)
      OR (quality_name = 'WEBDL-2160p'
        AND position = 1)
      OR (quality_name = 'Bluray-1080p'
        AND position = 2)
      OR (quality_name = 'WEBDL-1080p'
        AND position = 3)
      OR (quality_name = 'WEBRip-1080p'
        AND position = 4)
      OR (quality_name = 'Bluray-720p'
        AND position = 5)
      OR (quality_name = 'WEBDL-720p'
        AND position = 6)
      OR (quality_name = 'WEBRip-720p'
        AND position = 7)
      OR (quality_name = 'Bluray-576p'
        AND position = 8)
      OR (quality_name = 'Bluray-480p'
        AND position = 9)
      OR (quality_name = 'WEBDL-480p'
        AND position = 10)
      OR (quality_name = 'DVD'
        AND position = 11)
      OR (quality_name = 'HDTV-1080p'
        AND position = 12)
      OR (quality_name = 'HDTV-720p'
        AND position = 13)
      OR (quality_name = 'SDTV'
        AND position = 14)
        )
    )
    OR NOT EXISTS (
      SELECT 1
      FROM quality_group_members
      WHERE quality_profile_name = '2160p Streaming'
  AND quality_group_name = '2160p Balanced'
        AND position != 0
    )
  );

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
WITH can_insert AS (
  SELECT (
    SELECT COUNT(*)
    FROM quality_group_members
    WHERE quality_profile_name = '2160p Streaming'
      AND quality_group_name = '2160p Balanced'
  ) = 0 AS ok
),
new_rows AS (
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'Bluray-2160p' AS quality_name, 0 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'WEBDL-2160p' AS quality_name, 1 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'Bluray-1080p' AS quality_name, 2 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'WEBDL-1080p' AS quality_name, 3 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'Bluray-720p' AS quality_name, 4 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'WEBDL-720p' AS quality_name, 5 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'WEBDL-480p' AS quality_name, 6 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'DVD' AS quality_name, 7 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'HDTV-1080p' AS quality_name, 8 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'HDTV-720p' AS quality_name, 9 AS position
UNION ALL
SELECT '2160p Streaming' AS quality_profile_name, '2160p Balanced' AS quality_group_name, 'SDTV' AS quality_name, 10 AS position
)
SELECT
  new_rows.quality_profile_name,
  new_rows.quality_group_name,
  new_rows.quality_name,
  new_rows.position
FROM new_rows
CROSS JOIN can_insert
WHERE ok;
-- --- END op 3501

-- --- BEGIN op 3502 ( update quality_profile "1080p Streaming" )
INSERT INTO quality_profile_qualities (quality_profile_name, quality_name, quality_group_name, position, enabled, upgrade_until)
SELECT '1080p Streaming', 'WEBRip-720p', NULL, 8, 0, 0
WHERE NOT EXISTS (
  SELECT 1 FROM quality_profile_qualities
  WHERE quality_profile_name = '1080p Streaming'
    AND quality_name = 'WEBRip-720p'
    AND quality_group_name IS NULL
);

UPDATE quality_profile_qualities
SET position = 9
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-576p'
  AND quality_group_name IS NULL
  AND position = 8
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 10
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Bluray-480p'
  AND quality_group_name IS NULL
  AND position = 9
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 11
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WEBRip-480p'
  AND quality_group_name IS NULL
  AND position = 10
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 12
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'HDTV-480p'
  AND quality_group_name IS NULL
  AND position = 11
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 13
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'BR-DISK'
  AND quality_group_name IS NULL
  AND position = 12
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 14
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'CAM'
  AND quality_group_name IS NULL
  AND position = 13
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 15
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVD-R'
  AND quality_group_name IS NULL
  AND position = 14
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 16
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'DVDSCR'
  AND quality_group_name IS NULL
  AND position = 15
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 17
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Raw-HD'
  AND quality_group_name IS NULL
  AND position = 16
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 18
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'REGIONAL'
  AND quality_group_name IS NULL
  AND position = 17
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 19
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'TELECINE'
  AND quality_group_name IS NULL
  AND position = 18
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 20
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'TELESYNC'
  AND quality_group_name IS NULL
  AND position = 19
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 21
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'WORKPRINT'
  AND quality_group_name IS NULL
  AND position = 20
  AND enabled = 0
  AND upgrade_until = 0;

UPDATE quality_profile_qualities
SET position = 22
WHERE quality_profile_name = '1080p Streaming'
  AND quality_name = 'Unknown'
  AND quality_group_name IS NULL
  AND position = 21
  AND enabled = 0
  AND upgrade_until = 0;

DELETE FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
  AND (SELECT COUNT(*)
FROM quality_group_members
WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming') = 10
  AND NOT EXISTS (
    SELECT 1
    FROM quality_group_members
    WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
      AND quality_name NOT IN ('Bluray-1080p', 'WEBDL-1080p', 'Bluray-720p', 'WEBDL-720p', 'WEBRip-720p', 'WEBDL-480p', 'DVD', 'HDTV-1080p', 'HDTV-720p', 'SDTV')
  )
  AND (
    NOT EXISTS (
      SELECT 1
      FROM quality_group_members
      WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
        AND NOT (
          (quality_name = 'Bluray-1080p'
        AND position = 0)
      OR (quality_name = 'WEBDL-1080p'
        AND position = 1)
      OR (quality_name = 'Bluray-720p'
        AND position = 2)
      OR (quality_name = 'WEBDL-720p'
        AND position = 3)
      OR (quality_name = 'WEBRip-720p'
        AND position = 4)
      OR (quality_name = 'WEBDL-480p'
        AND position = 5)
      OR (quality_name = 'DVD'
        AND position = 6)
      OR (quality_name = 'HDTV-1080p'
        AND position = 7)
      OR (quality_name = 'HDTV-720p'
        AND position = 8)
      OR (quality_name = 'SDTV'
        AND position = 9)
        )
    )
    OR NOT EXISTS (
      SELECT 1
      FROM quality_group_members
      WHERE quality_profile_name = '1080p Streaming'
  AND quality_group_name = '1080p Streaming'
        AND position != 0
    )
  );

INSERT INTO quality_group_members (quality_profile_name, quality_group_name, quality_name, position)
WITH can_insert AS (
  SELECT (
    SELECT COUNT(*)
    FROM quality_group_members
    WHERE quality_profile_name = '1080p Streaming'
      AND quality_group_name = '1080p Streaming'
  ) = 0 AS ok
),
new_rows AS (
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'Bluray-1080p' AS quality_name, 0 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'WEBDL-1080p' AS quality_name, 1 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'Bluray-720p' AS quality_name, 2 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'WEBDL-720p' AS quality_name, 3 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'WEBDL-480p' AS quality_name, 4 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'DVD' AS quality_name, 5 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'HDTV-1080p' AS quality_name, 6 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'HDTV-720p' AS quality_name, 7 AS position
UNION ALL
SELECT '1080p Streaming' AS quality_profile_name, '1080p Streaming' AS quality_group_name, 'SDTV' AS quality_name, 8 AS position
)
SELECT
  new_rows.quality_profile_name,
  new_rows.quality_group_name,
  new_rows.quality_name,
  new_rows.position
FROM new_rows
CROSS JOIN can_insert
WHERE ok;
-- --- END op 3502

-- --- BEGIN op 3503 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Bluray'
  AND arr_type = 'radarr'
  AND score = 700000;
-- --- END op 3503

-- --- BEGIN op 3504 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Bluray'
  AND arr_type = 'sonarr'
  AND score = 700000;
-- --- END op 3504

-- --- BEGIN op 3505 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p WEBRip'
  AND arr_type = 'radarr'
  AND score = 700000;
-- --- END op 3505

-- --- BEGIN op 3506 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Bluray'
  AND arr_type = 'radarr'
  AND score = 320000;
-- --- END op 3506

-- --- BEGIN op 3507 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Bluray'
  AND arr_type = 'sonarr'
  AND score = 320000;
-- --- END op 3507

-- --- BEGIN op 3508 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Bluray'
  AND arr_type = 'radarr'
  AND score = 420000;
-- --- END op 3508

-- --- BEGIN op 3509 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Bluray'
  AND arr_type = 'sonarr'
  AND score = 420000;
-- --- END op 3509

-- --- BEGIN op 3510 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Bluray'
  AND arr_type = 'radarr'
  AND score = 540000;
-- --- END op 3510

-- --- BEGIN op 3511 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Bluray'
  AND arr_type = 'sonarr'
  AND score = 540000;
-- --- END op 3511

-- --- BEGIN op 3512 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p WEBRip'
  AND arr_type = 'radarr'
  AND score = 540000;
-- --- END op 3512

-- --- BEGIN op 3513 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 1'
  AND arr_type = 'all'
  AND score = 125000;
-- --- END op 3513

-- --- BEGIN op 3514 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 2'
  AND arr_type = 'all'
  AND score = 124000;
-- --- END op 3514

-- --- BEGIN op 3515 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 3'
  AND arr_type = 'all'
  AND score = 123000;
-- --- END op 3515

-- --- BEGIN op 3516 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 4'
  AND arr_type = 'all'
  AND score = 122000;
-- --- END op 3516

-- --- BEGIN op 3517 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 5'
  AND arr_type = 'all'
  AND score = 121000;
-- --- END op 3517

-- --- BEGIN op 3518 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 6'
  AND arr_type = 'all'
  AND score = 120000;
-- --- END op 3518

-- --- BEGIN op 3519 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 1'
  AND arr_type = 'all'
  AND score = 85000;
-- --- END op 3519

-- --- BEGIN op 3520 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 2'
  AND arr_type = 'all'
  AND score = 84000;
-- --- END op 3520

-- --- BEGIN op 3521 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 3'
  AND arr_type = 'all'
  AND score = 83000;
-- --- END op 3521

-- --- BEGIN op 3522 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 4'
  AND arr_type = 'all'
  AND score = 82000;
-- --- END op 3522

-- --- BEGIN op 3523 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 5'
  AND arr_type = 'all'
  AND score = 81000;
-- --- END op 3523

-- --- BEGIN op 3524 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 6'
  AND arr_type = 'all'
  AND score = 80000;
-- --- END op 3524

-- --- BEGIN op 3525 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 1'
  AND arr_type = 'radarr'
  AND score = 185000;
-- --- END op 3525

-- --- BEGIN op 3526 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 1'
  AND arr_type = 'sonarr'
  AND score = 185000;
-- --- END op 3526

-- --- BEGIN op 3527 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 2'
  AND arr_type = 'radarr'
  AND score = 184000;
-- --- END op 3527

-- --- BEGIN op 3528 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 2'
  AND arr_type = 'sonarr'
  AND score = 184000;
-- --- END op 3528

-- --- BEGIN op 3529 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 3'
  AND arr_type = 'radarr'
  AND score = 183000;
-- --- END op 3529

-- --- BEGIN op 3530 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 3'
  AND arr_type = 'sonarr'
  AND score = 183000;
-- --- END op 3530

-- --- BEGIN op 3531 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 4'
  AND arr_type = 'radarr'
  AND score = 182000;
-- --- END op 3531

-- --- BEGIN op 3532 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 4'
  AND arr_type = 'sonarr'
  AND score = 182000;
-- --- END op 3532

-- --- BEGIN op 3533 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 5'
  AND arr_type = 'radarr'
  AND score = 181000;
-- --- END op 3533

-- --- BEGIN op 3534 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 5'
  AND arr_type = 'sonarr'
  AND score = 181000;
-- --- END op 3534

-- --- BEGIN op 3535 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 6'
  AND arr_type = 'radarr'
  AND score = 180000;
-- --- END op 3535

-- --- BEGIN op 3536 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Quality Tier 6'
  AND arr_type = 'sonarr'
  AND score = 180000;
-- --- END op 3536

-- --- BEGIN op 3537 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 1'
  AND arr_type = 'radarr'
  AND score = 83000;
-- --- END op 3537

-- --- BEGIN op 3538 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 1'
  AND arr_type = 'sonarr'
  AND score = 83000;
-- --- END op 3538

-- --- BEGIN op 3539 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 2'
  AND arr_type = 'radarr'
  AND score = 82000;
-- --- END op 3539

-- --- BEGIN op 3540 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 2'
  AND arr_type = 'sonarr'
  AND score = 82000;
-- --- END op 3540

-- --- BEGIN op 3541 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 3'
  AND arr_type = 'radarr'
  AND score = 81000;
-- --- END op 3541

-- --- BEGIN op 3542 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 3'
  AND arr_type = 'sonarr'
  AND score = 81000;
-- --- END op 3542

-- --- BEGIN op 3543 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 4'
  AND arr_type = 'radarr'
  AND score = 80000;
-- --- END op 3543

-- --- BEGIN op 3544 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '480p Quality Tier 4'
  AND arr_type = 'sonarr'
  AND score = 80000;
-- --- END op 3544

-- --- BEGIN op 3545 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 1'
  AND arr_type = 'radarr'
  AND score = 103000;
-- --- END op 3545

-- --- BEGIN op 3546 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 1'
  AND arr_type = 'sonarr'
  AND score = 103000;
-- --- END op 3546

-- --- BEGIN op 3547 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 2'
  AND arr_type = 'radarr'
  AND score = 102000;
-- --- END op 3547

-- --- BEGIN op 3548 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 2'
  AND arr_type = 'sonarr'
  AND score = 102000;
-- --- END op 3548

-- --- BEGIN op 3549 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 3'
  AND arr_type = 'radarr'
  AND score = 101000;
-- --- END op 3549

-- --- BEGIN op 3550 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 3'
  AND arr_type = 'sonarr'
  AND score = 101000;
-- --- END op 3550

-- --- BEGIN op 3551 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 4'
  AND arr_type = 'radarr'
  AND score = 100000;
-- --- END op 3551

-- --- BEGIN op 3552 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '576p Quality Tier 4'
  AND arr_type = 'sonarr'
  AND score = 100000;
-- --- END op 3552

-- --- BEGIN op 3553 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 1'
  AND arr_type = 'radarr'
  AND score = 145000;
-- --- END op 3553

-- --- BEGIN op 3554 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 1'
  AND arr_type = 'sonarr'
  AND score = 145000;
-- --- END op 3554

-- --- BEGIN op 3555 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 2'
  AND arr_type = 'radarr'
  AND score = 144000;
-- --- END op 3555

-- --- BEGIN op 3556 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 2'
  AND arr_type = 'sonarr'
  AND score = 144000;
-- --- END op 3556

-- --- BEGIN op 3557 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 3'
  AND arr_type = 'radarr'
  AND score = 143000;
-- --- END op 3557

-- --- BEGIN op 3558 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 3'
  AND arr_type = 'sonarr'
  AND score = 143000;
-- --- END op 3558

-- --- BEGIN op 3559 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 4'
  AND arr_type = 'radarr'
  AND score = 142000;
-- --- END op 3559

-- --- BEGIN op 3560 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 4'
  AND arr_type = 'sonarr'
  AND score = 142000;
-- --- END op 3560

-- --- BEGIN op 3561 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 5'
  AND arr_type = 'radarr'
  AND score = 141000;
-- --- END op 3561

-- --- BEGIN op 3562 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 5'
  AND arr_type = 'sonarr'
  AND score = 141000;
-- --- END op 3562

-- --- BEGIN op 3563 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 6'
  AND arr_type = 'radarr'
  AND score = 140000;
-- --- END op 3563

-- --- BEGIN op 3564 ( update quality_profile "2160p Streaming" )
DELETE FROM quality_profile_custom_formats
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Quality Tier 6'
  AND arr_type = 'sonarr'
  AND score = 140000;
-- --- END op 3564

-- --- BEGIN op 3565 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p WEB-DL'
  AND arr_type = 'radarr'
  AND score = 860000;
-- --- END op 3565

-- --- BEGIN op 3566 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p WEB-DL'
  AND arr_type = 'sonarr'
  AND score = 860000;
-- --- END op 3566

-- --- BEGIN op 3567 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 360000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p WEB-DL'
  AND arr_type = 'radarr'
  AND score = 920000;
-- --- END op 3567

-- --- BEGIN op 3568 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 360000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p WEB-DL'
  AND arr_type = 'sonarr'
  AND score = 920000;
-- --- END op 3568

-- --- BEGIN op 3569 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p WEB-DL'
  AND arr_type = 'radarr'
  AND score = 660000;
-- --- END op 3569

-- --- BEGIN op 3570 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p WEB-DL'
  AND arr_type = 'sonarr'
  AND score = 660000;
-- --- END op 3570

-- --- BEGIN op 3571 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 341000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Balanced Tier 1'
  AND arr_type = 'radarr'
  AND score = 161000;
-- --- END op 3571

-- --- BEGIN op 3572 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 341000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Balanced Tier 1'
  AND arr_type = 'sonarr'
  AND score = 161000;
-- --- END op 3572

-- --- BEGIN op 3573 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Balanced Tier 2'
  AND arr_type = 'radarr'
  AND score = 160000;
-- --- END op 3573

-- --- BEGIN op 3574 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 340000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '1080p Balanced Tier 2'
  AND arr_type = 'sonarr'
  AND score = 160000;
-- --- END op 3574

-- --- BEGIN op 3575 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 362000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p Balanced Tier 1'
  AND arr_type = 'radarr'
  AND score = 922000;
-- --- END op 3575

-- --- BEGIN op 3576 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 364000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p Balanced Tier 1'
  AND arr_type = 'sonarr'
  AND score = 924000;
-- --- END op 3576

-- --- BEGIN op 3577 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 361000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p Balanced Tier 2'
  AND arr_type = 'radarr'
  AND score = 921000;
-- --- END op 3577

-- --- BEGIN op 3578 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 361000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p Balanced Tier 2'
  AND arr_type = 'sonarr'
  AND score = 921000;
-- --- END op 3578

-- --- BEGIN op 3579 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 360000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p Balanced Tier 3'
  AND arr_type = 'radarr'
  AND score = 920000;
-- --- END op 3579

-- --- BEGIN op 3580 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 360000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '2160p Balanced Tier 3'
  AND arr_type = 'sonarr'
  AND score = 920000;
-- --- END op 3580

-- --- BEGIN op 3581 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Balanced Tier 1'
  AND arr_type = 'radarr'
  AND score = 120000;
-- --- END op 3581

-- --- BEGIN op 3582 ( update quality_profile "2160p Streaming" )
UPDATE quality_profile_custom_formats
SET score = 320000
WHERE quality_profile_name = '2160p Streaming'
  AND custom_format_name = '720p Balanced Tier 1'
  AND arr_type = 'sonarr'
  AND score = 120000;
-- --- END op 3582
