diff --git a/custom_formats/audio/ATMOS (Missing).json b/custom_formats/audio/ATMOS (Missing).json new file mode 100644 index 0000000..5af24d0 --- /dev/null +++ b/custom_formats/audio/ATMOS (Missing).json @@ -0,0 +1,69 @@ +{ + "name": "ATMOS (Missing)", + "includeCustomFormatWhenRenaming": false, + "specifications": [ + { + "name": "TrueHD", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": false, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "True[ .-]?HD[ .-]?7\\.1", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + }, + { + "name": "Atmos", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": true, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\bATMOS(\\b|\\d)", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + }, + { + "name": "7.1", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": false, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "7.1", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + } + ] +} diff --git a/custom_formats/audio/ATMOS.json b/custom_formats/audio/ATMOS.json new file mode 100644 index 0000000..2ecb3e3 --- /dev/null +++ b/custom_formats/audio/ATMOS.json @@ -0,0 +1,27 @@ +{ + "name": "ATMOS", + "includeCustomFormatWhenRenaming": true, + "specifications": [ + { + "name": "ATMOS", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": false, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\bATMOS(\\b|\\d)", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + } + ] +} diff --git a/custom_formats/audio/DD+.json b/custom_formats/audio/DD+.json new file mode 100644 index 0000000..dabcc2d --- /dev/null +++ b/custom_formats/audio/DD+.json @@ -0,0 +1,132 @@ +{ + "name": "DD+", + "includeCustomFormatWhenRenaming": false, + "specifications": [ + { + "name": "Dolby Digital Plus", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": false, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\bDD[P+](?!A)|\\b(e[-_. ]?ac3)\\b", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + }, + { + "name": "TrueHD", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": true, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "True[ .-]?HD", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + }, + { + "name": "Not DTS", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": true, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\bDTS(\\b|\\d)", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + }, + { + "name": "Not FLAC", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": true, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\bFLAC(\\b|\\d)", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + }, + { + "name": "Not AAC", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": true, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\bAAC(\\b|\\d)", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + }, + { + "name": "Not PCM", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": true, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\b(l?)PCM(\\b|\\d)", + "type": "textbox", + "advanced": false, + "privacy": "normal", + "isFloat": false + } + ] + } + ] +} diff --git a/custom_formats/audio/DD.json b/custom_formats/audio/DD.json new file mode 100644 index 0000000..768751b --- /dev/null +++ b/custom_formats/audio/DD.json @@ -0,0 +1,153 @@ +{ + "name": "DD", + "includeCustomFormatWhenRenaming": true, + "specifications": [ + { + "name": "Basic Dolby Digital", + "implementation": "ReleaseTitleSpecification", + "implementationName": "Release Title", + "infoLink": "https://wiki.servarr.com/radarr/settings#custom-formats-2", + "negate": false, + "required": true, + "fields": [ + { + "order": 0, + "name": "value", + "label": "Regular Expression", + "helpText": "Custom Format RegEx is Case Insensitive", + "value": "\\bDD[^a-z+]|(? /dev/null +then + echo "jq could not be found. Please install jq before running this script." + exit 1 +fi + +# Check if input file is provided as an argument +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Input JSON file +input_file="$1" + +# Check if the input file exists +if [[ ! -f "$input_file" ]]; then + echo "Input file not found: $input_file" + exit 1 +fi + +# Create output directory if it doesn't exist +output_dir="../output" +mkdir -p "$output_dir" + +# Function to sanitize filenames by removing slashes +sanitize_filename() { + echo "$1" | tr -d '/' +} + +# Read each object in the array and save to a separate JSON file +jq -c '.[]' "$input_file" | while read -r object; do + name=$(echo "$object" | jq -r '.name') + if [[ -n "$name" ]]; then + sanitized_name=$(sanitize_filename "$name") + echo "$object" | jq '.' > "$output_dir/$sanitized_name.json" + echo "Created file: $output_dir/$sanitized_name.json" + else + echo "Skipping object without a name field: $object" + fi +done + +echo "Finished processing JSON objects."