fix: align terraform resources with actual provider schema
Use nested attribute assignment instead of dynamic blocks for specifications, quality_groups, and format_items. Add required language field to quality profiles. Remove unsupported delay_profile fields. Flatten custom format specifications to use value/min/max directly.
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
include_custom_format_when_renaming: false
|
||||
specifications:
|
||||
- name: 1080p
|
||||
- name: 1080p
|
||||
implementation: ResolutionSpecification
|
||||
negate: false
|
||||
required: false
|
||||
fields:
|
||||
- name: value
|
||||
value: "1080"
|
||||
value: '1080'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
include_custom_format_when_renaming: false
|
||||
specifications:
|
||||
- name: 2160p
|
||||
- name: 2160p
|
||||
implementation: ResolutionSpecification
|
||||
negate: false
|
||||
required: false
|
||||
fields:
|
||||
- name: value
|
||||
value: "2160"
|
||||
value: '2160'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
include_custom_format_when_renaming: false
|
||||
specifications:
|
||||
- name: 720p
|
||||
- name: 720p
|
||||
implementation: ResolutionSpecification
|
||||
negate: false
|
||||
required: false
|
||||
fields:
|
||||
- name: value
|
||||
value: "720"
|
||||
value: '720'
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
include_custom_format_when_renaming: false
|
||||
specifications:
|
||||
- name: x264
|
||||
- name: x264
|
||||
implementation: ReleaseTitleSpecification
|
||||
negate: false
|
||||
required: false
|
||||
fields:
|
||||
- name: value
|
||||
value: "(x|h)\\.?264"
|
||||
value: (x|h)\.?264
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
include_custom_format_when_renaming: false
|
||||
specifications:
|
||||
- name: x265
|
||||
- name: x265
|
||||
implementation: ReleaseTitleSpecification
|
||||
negate: false
|
||||
required: false
|
||||
fields:
|
||||
- name: value
|
||||
value: "(((x|h)\\.?265)|(HEVC))"
|
||||
value: (((x|h)\.?265)|(HEVC))
|
||||
|
||||
@@ -4,6 +4,4 @@ preferred_protocol: usenet
|
||||
usenet_delay: 0
|
||||
torrent_delay: 0
|
||||
bypass_if_highest_quality: true
|
||||
bypass_if_above_custom_format_score: false
|
||||
minimum_custom_format_score: 0
|
||||
tags: []
|
||||
|
||||
@@ -14,4 +14,3 @@ categories:
|
||||
- 2045
|
||||
- 2050
|
||||
- 2060
|
||||
download_client_id: 0
|
||||
|
||||
@@ -3,76 +3,79 @@ cutoff: 7
|
||||
cutoff_format_score: 5000
|
||||
min_format_score: 0
|
||||
quality_groups:
|
||||
- id: 20
|
||||
- id: 20
|
||||
qualities:
|
||||
- id: 20
|
||||
name: Bluray-480p
|
||||
source: bluray
|
||||
resolution: 480
|
||||
- id: 21
|
||||
- id: 21
|
||||
qualities:
|
||||
- id: 21
|
||||
name: Bluray-576p
|
||||
source: bluray
|
||||
resolution: 576
|
||||
- id: 4
|
||||
- id: 4
|
||||
qualities:
|
||||
- id: 4
|
||||
name: HDTV-720p
|
||||
source: tv
|
||||
resolution: 720
|
||||
- id: 5
|
||||
- id: 5
|
||||
qualities:
|
||||
- id: 5
|
||||
name: WEBDL-720p
|
||||
source: webdl
|
||||
resolution: 720
|
||||
- id: 14
|
||||
- id: 14
|
||||
qualities:
|
||||
- id: 14
|
||||
name: WEBRip-720p
|
||||
source: webrip
|
||||
resolution: 720
|
||||
- id: 6
|
||||
- id: 6
|
||||
qualities:
|
||||
- id: 6
|
||||
name: Bluray-720p
|
||||
source: bluray
|
||||
resolution: 720
|
||||
- id: 9
|
||||
- id: 9
|
||||
qualities:
|
||||
- id: 9
|
||||
name: HDTV-1080p
|
||||
source: tv
|
||||
resolution: 1080
|
||||
- id: 3
|
||||
- id: 3
|
||||
qualities:
|
||||
- id: 3
|
||||
name: WEBDL-1080p
|
||||
source: webdl
|
||||
resolution: 1080
|
||||
- id: 15
|
||||
- id: 15
|
||||
qualities:
|
||||
- id: 15
|
||||
name: WEBRip-1080p
|
||||
source: webrip
|
||||
resolution: 1080
|
||||
- id: 7
|
||||
- id: 7
|
||||
qualities:
|
||||
- id: 7
|
||||
name: Bluray-1080p
|
||||
source: bluray
|
||||
resolution: 1080
|
||||
format_items:
|
||||
- name: x264
|
||||
- name: x264
|
||||
format: x264
|
||||
score: -200
|
||||
- name: x265
|
||||
- name: x265
|
||||
format: x265
|
||||
score: 1000
|
||||
- name: 1080p
|
||||
- name: 1080p
|
||||
format: 1080p
|
||||
score: 500
|
||||
- name: 720p
|
||||
- name: 720p
|
||||
format: 720p
|
||||
score: 200
|
||||
language:
|
||||
id: 1
|
||||
name: English
|
||||
|
||||
@@ -3,34 +3,37 @@ cutoff: 19
|
||||
cutoff_format_score: 5000
|
||||
min_format_score: 0
|
||||
quality_groups:
|
||||
- id: 18
|
||||
- id: 18
|
||||
qualities:
|
||||
- id: 18
|
||||
name: WEBDL-2160p
|
||||
source: webdl
|
||||
resolution: 2160
|
||||
- id: 17
|
||||
- id: 17
|
||||
qualities:
|
||||
- id: 17
|
||||
name: WEBRip-2160p
|
||||
source: webrip
|
||||
resolution: 2160
|
||||
- id: 19
|
||||
- id: 19
|
||||
qualities:
|
||||
- id: 19
|
||||
name: Bluray-2160p
|
||||
source: bluray
|
||||
resolution: 2160
|
||||
format_items:
|
||||
- name: 2160p
|
||||
- name: 2160p
|
||||
format: 2160p
|
||||
score: 2000
|
||||
- name: 1080p
|
||||
- name: 1080p
|
||||
format: 1080p
|
||||
score: 500
|
||||
- name: x265
|
||||
- name: x265
|
||||
format: x265
|
||||
score: 2000
|
||||
- name: x264
|
||||
- name: x264
|
||||
format: x264
|
||||
score: -5000
|
||||
language:
|
||||
id: 1
|
||||
name: English
|
||||
|
||||
@@ -3,8 +3,8 @@ cutoff: 1002
|
||||
cutoff_format_score: 300
|
||||
min_format_score: 300
|
||||
quality_groups:
|
||||
- id: 1002
|
||||
name: "WEB 1080p"
|
||||
- id: 1002
|
||||
name: WEB 1080p
|
||||
qualities:
|
||||
- id: 3
|
||||
name: WEBDL-1080p
|
||||
@@ -15,18 +15,21 @@ quality_groups:
|
||||
source: webrip
|
||||
resolution: 1080
|
||||
format_items:
|
||||
- name: 2160p
|
||||
- name: 2160p
|
||||
format: 2160p
|
||||
score: -300
|
||||
- name: x264
|
||||
- name: x264
|
||||
format: x264
|
||||
score: -200
|
||||
- name: x265
|
||||
- name: x265
|
||||
format: x265
|
||||
score: -200
|
||||
- name: 1080p
|
||||
- name: 1080p
|
||||
format: 1080p
|
||||
score: -200
|
||||
- name: 720p
|
||||
- name: 720p
|
||||
format: 720p
|
||||
score: 300
|
||||
language:
|
||||
id: 1
|
||||
name: English
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# This file is maintained automatically by "tofu init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.opentofu.org/devopsarr/radarr" {
|
||||
version = "2.3.5"
|
||||
constraints = "2.3.5"
|
||||
hashes = [
|
||||
"h1:wrU8A9nJHJ1W1VUSGC9O/J7AUJQOyY1OvKMDuL4W4Kw=",
|
||||
"zh:18cb2579f9312aee8d17ffa938664f71c9376abea0a6da3d053ebdaef66a2f62",
|
||||
"zh:19dbdff678f6f5b90da2f61ef4b1afed619a317474b344f9de15db35c57e2e47",
|
||||
"zh:21af82e9cdd7b85f6a943655675bae1d330d225e6c4c683f9bbabfc938280228",
|
||||
"zh:26bebd01c85d457dbe7e80978456695f00396ed830878b0151d495a4ce7ef4ba",
|
||||
"zh:66eba536cf2b5de49c62386e65910347cb4deac6cdf9bec920a1090db6a8a5a4",
|
||||
"zh:6905bbfbec2b7d67cab381c6491c018163e7cb410e55bfedc598ada378643c56",
|
||||
"zh:78bdf398fe1db2c63c2ccc9da1b8fc27fb711ae831bef91e3ea198d7d684dc98",
|
||||
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
|
||||
"zh:8cff19564bf543894fbbca5c936f47fa9446724cefbaa2f63dedd79feb3ca52a",
|
||||
"zh:94be12c4165d5fda164aff3e7b600e9dab40528563a0758dd198c9ace69437b6",
|
||||
"zh:9c22c104248cb8022935df1674404bded46a4f4f54daf6ba96ee800316eb95b9",
|
||||
"zh:a5d217038373d605531537ebaecae8ba136b8c7198a50c6a47c6932cb8485737",
|
||||
"zh:c244be13b67eecbd395b123986343e77f168dc07eaaf888bc8206db2ba4a6cfc",
|
||||
"zh:cee38aa1920f5d37ea56421b0ea57ebcefde87b0c57a61c5aa6476d4f185291a",
|
||||
"zh:e95c3c4caad13cf1e4e37b721205d09564978d514f42ccb56d7ea94a498dad7e",
|
||||
]
|
||||
}
|
||||
+12
-49
@@ -2,24 +2,7 @@ resource "radarr_custom_format" "this" {
|
||||
for_each = var.custom_formats
|
||||
name = each.key
|
||||
include_custom_format_when_renaming = lookup(each.value, "include_custom_format_when_renaming", false)
|
||||
|
||||
dynamic "specifications" {
|
||||
for_each = each.value.specifications
|
||||
content {
|
||||
name = specifications.value.name
|
||||
implementation = specifications.value.implementation
|
||||
negate = lookup(specifications.value, "negate", false)
|
||||
required = lookup(specifications.value, "required", false)
|
||||
|
||||
dynamic "fields" {
|
||||
for_each = lookup(specifications.value, "fields", [])
|
||||
content {
|
||||
name = fields.value.name
|
||||
value = tostring(lookup(fields.value, "value", ""))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
specifications = each.value.specifications
|
||||
}
|
||||
|
||||
resource "radarr_quality_profile" "this" {
|
||||
@@ -29,33 +12,16 @@ resource "radarr_quality_profile" "this" {
|
||||
cutoff = each.value.cutoff
|
||||
cutoff_format_score = lookup(each.value, "cutoff_format_score", 0)
|
||||
min_format_score = lookup(each.value, "min_format_score", 0)
|
||||
quality_groups = each.value.quality_groups
|
||||
language = each.value.language
|
||||
|
||||
dynamic "quality_groups" {
|
||||
for_each = each.value.quality_groups
|
||||
content {
|
||||
id = quality_groups.value.id
|
||||
name = lookup(quality_groups.value, "name", null)
|
||||
|
||||
dynamic "qualities" {
|
||||
for_each = quality_groups.value.qualities
|
||||
content {
|
||||
id = qualities.value.id
|
||||
name = qualities.value.name
|
||||
source = qualities.value.source
|
||||
resolution = qualities.value.resolution
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "format_items" {
|
||||
for_each = lookup(each.value, "format_items", [])
|
||||
content {
|
||||
name = format_items.value.name
|
||||
format = format_items.value.format
|
||||
score = format_items.value.score
|
||||
}
|
||||
format_items = [
|
||||
for fi in lookup(each.value, "format_items", []) : {
|
||||
name = fi.name
|
||||
format = radarr_custom_format.this[fi.format].id
|
||||
score = fi.score
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
resource "radarr_download_client_nzbget" "this" {
|
||||
@@ -84,7 +50,6 @@ resource "radarr_indexer_newznab" "this" {
|
||||
api_path = lookup(each.value, "api_path", "/api")
|
||||
api_key = lookup(each.value, "api_key", "")
|
||||
categories = lookup(each.value, "categories", [])
|
||||
download_client_id = lookup(each.value, "download_client_id", 0)
|
||||
}
|
||||
|
||||
resource "radarr_notification_emby" "this" {
|
||||
@@ -93,7 +58,7 @@ resource "radarr_notification_emby" "this" {
|
||||
host = each.value.host
|
||||
port = each.value.port
|
||||
use_ssl = lookup(each.value, "use_ssl", false)
|
||||
api_key = lookup(each.value, "api_key", "")
|
||||
api_key = each.value.api_key
|
||||
notify = lookup(each.value, "notify", false)
|
||||
update_library = lookup(each.value, "update_library", true)
|
||||
|
||||
@@ -101,7 +66,7 @@ resource "radarr_notification_emby" "this" {
|
||||
on_download = lookup(each.value, "on_download", true)
|
||||
on_upgrade = lookup(each.value, "on_upgrade", true)
|
||||
on_rename = lookup(each.value, "on_rename", true)
|
||||
on_movie_delete = lookup(each.value, "on_movie_delete", true)
|
||||
on_movie_delete = each.value.on_movie_delete
|
||||
on_movie_file_delete = lookup(each.value, "on_movie_file_delete", true)
|
||||
on_movie_file_delete_for_upgrade = lookup(each.value, "on_movie_file_delete_for_upgrade", true)
|
||||
on_application_update = lookup(each.value, "on_application_update", true)
|
||||
@@ -115,9 +80,7 @@ resource "radarr_delay_profile" "this" {
|
||||
usenet_delay = lookup(each.value, "usenet_delay", 0)
|
||||
torrent_delay = lookup(each.value, "torrent_delay", 0)
|
||||
bypass_if_highest_quality = lookup(each.value, "bypass_if_highest_quality", true)
|
||||
bypass_if_above_custom_format_score = lookup(each.value, "bypass_if_above_custom_format_score", false)
|
||||
minimum_custom_format_score = lookup(each.value, "minimum_custom_format_score", 0)
|
||||
tags = lookup(each.value, "tags", [])
|
||||
tags = each.value.tags
|
||||
}
|
||||
|
||||
resource "radarr_root_folder" "this" {
|
||||
|
||||
Reference in New Issue
Block a user