diff --git a/README.md b/README.md index 5f3143b3..60f09dff 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,9 @@ Automatically mirror TRaSH guides to your Sonarr/Radarr instance. -## Features +## Sonarr Features -Features list will continue to grow. See the limitations & roadmap section for more details! - -### Sonarr - -Release Profiles +### Release Profiles - "Preferred", "Must Not Contain", and "Must Contain" terms from guides are reflected in corresponding release profile fields in Sonarr. @@ -26,17 +22,25 @@ Release Profiles - Terms mentioned as "optional" in the guide are not synced to Sonarr release profiles by default (can be enabled via config). -Quality Definitions +### Quality Definitions - Anime and Series (Non-Anime) quality definitions from the guide. - "Hybrid" type supported that is a mixture of both. -### Radarr +## Radarr Features -Quality Definitions +### Quality Definitions - Movie quality definition from the guide +### Custom Formats + +- A user-specified list of custom formats are synchronized to Radarr from the TRaSH guides. +- Scores from the guides can be synchronized to quality profiles of your choosing. +- User can specify their own scores for custom formats (instead of using the guide score). +- Option to enable automatic deletion custom formats in Radarr when they are removed from config or + the guide. + ## Installation Simply download the latest release for your platform: @@ -48,7 +52,17 @@ Simply download the latest release for your platform: The above links are from the latest release on the [releases page][rp]. Feel free to visit there for release notes and older releases. -> **Note**: For Sonarr updates to work, you must be running version `3.0.4.1098` or greater. +--- + +*Important Notices!* + +- > **Note**: For Sonarr updates to work, you must be running version `3.0.4.1098` or greater. + +- > **Note**: Do not run Notifiarr's Trash Guides Integration in conjunction with Trash Updater's + > Custom Format synchronization. In general, you should not have two different tools updating the + > same data in Radarr. + +--- [rp]: https://github.com/rcdailey/trash-updater/releases diff --git a/wiki/Configuration-Examples.md b/wiki/Configuration-Examples.md index 27928802..cbc1fe89 100644 --- a/wiki/Configuration-Examples.md +++ b/wiki/Configuration-Examples.md @@ -1,8 +1,11 @@ -Various scenarios supported using the flexible configuration support. +Various scenarios supported using flexible configuration structure: - [Update as much as possible in both Sonarr and Radarr with a single config](#update-as-much-as-possible-in-both-sonarr-and-radarr-with-a-single-config) - [Selectively update different parts of Sonarr](#selectively-update-different-parts-of-sonarr) - [Update multiple Sonarr instances in a single YAML config](#update-multiple-sonarr-instances-in-a-single-yaml-config) +- [Synchronize a lot of custom formats for a single quality profile](#synchronize-a-lot-of-custom-formats-for-a-single-quality-profile) +- [Manually assign different scores to multiple custom formats](#manually-assign-different-scores-to-multiple-custom-formats) +- [Assign custom format scores the same way to multiple quality profiles](#assign-custom-format-scores-the-same-way-to-multiple-quality-profiles) ## Update as much as possible in both Sonarr and Radarr with a single config @@ -113,3 +116,120 @@ update both instances. You can also split theses two instances across different YAML files if you do not want both to update at the same time. There's an example of how to do that in a different section of this page. + +## Synchronize a lot of custom formats for a single quality profile + +I want to be able to synchronize a list of custom formats to Radarr. In addition, I want the scores +in the guide to be applied to a single quality profile. + +```yml +radarr: + - base_url: http://localhost:7878 + api_key: 87674e2c316645ed85696a91a3d41988 + + custom_formats: + # Advanced Audio from the guide + - names: + - TrueHD ATMOS + - DTS X + - ATMOS (undefined) + - DD+ ATMOS + - TrueHD + - DTS-HD MA + - FLAC + - PCM + - DTS-HD HRA + - DD+ + - DTS-ES + - DTS + - AAC + - DD + quality_profiles: + - name: SD +``` + +## Manually assign different scores to multiple custom formats + +I want to synchronize custom formats to Radarr. I also do not want to use the scores in the guide. +Instead, I want to assign my own distinct score to each custom format in a single quality profile. + + +```yml +radarr: + - base_url: http://localhost:7878 + api_key: 87674e2c316645ed85696a91a3d41988 + + custom_formats: + - names: [TrueHD ATMOS] + quality_profiles: + - name: SD + score: 100 + - names: [DTS X] + quality_profiles: + - name: SD + score: 200 + - names: [ATMOS (undefined)] + quality_profiles: + - name: SD + score: 300 + - names: [TrueHD] + quality_profiles: + - name: SD + score: 400 + - names: [DTS-HD MA] + quality_profiles: + - name: SD + score: 500 + - names: [FLAC] + quality_profiles: + - name: SD + score: 600 +``` + +The configuration is structured around assigning multiple custom formats the same way to just a few +quality profiles. It starts to look more redundant and ugly when you want fine-grained control over +the scores, especially if its on a per-single-custom-format basis. + +## Assign custom format scores the same way to multiple quality profiles + +You can assign custom format scores (from the guide) to multiple profiles (all the same way): + +```yml +radarr: + - base_url: http://localhost:7878 + api_key: 87674e2c316645ed85696a91a3d41988 + + custom_formats: + - names: + - TrueHD ATMOS + - DTS X + - ATMOS (undefined) + - DD+ ATMOS + - TrueHD + quality_profiles: + - name: SD + - name: Ultra-HD +``` + +Quality profiles named `HD` and `Ultra-HD` will all receive the same scores for the same custom +formats. + +You can also choose to override the score (for all custom formats!) in one profile: + +```yml +radarr: + - base_url: http://localhost:7878 + api_key: 87674e2c316645ed85696a91a3d41988 + + custom_formats: + - names: + - TrueHD ATMOS + - DTS X + - ATMOS (undefined) + - DD+ ATMOS + - TrueHD + quality_profiles: + - name: SD + score: 100 # This score is assigned to all 5 CFs in this profile + - name: Ultra-HD # Still uses scores from the guide +``` diff --git a/wiki/Configuration-Reference.md b/wiki/Configuration-Reference.md index 0cc42823..6c2a48ee 100644 --- a/wiki/Configuration-Reference.md +++ b/wiki/Configuration-Reference.md @@ -1,7 +1,7 @@ -Reference documentation for the YAML documentation. For various configuration examples, see the -[[Configuration Examples]] page. +Reference documentation for the YAML configuration. For various examples, see the [[Configuration +Examples]] page. -## Summary +# Summary The Trash Updater program utilizes YAML for its configuration files. The configuration can be set up multiple ways, offering a lot of flexibility: @@ -9,6 +9,7 @@ multiple ways, offering a lot of flexibility: - You may use one or more YAML files simultaneously, allowing you to divide your configuration properties up in such a way that you can control what gets updated based on which files you specify. + - Each YAML file may have one or more service configurations. This means you can have one file define settings for just Sonarr, Radarr, or both services. The program will only read the configuration from the file relevant for the specific service subcommand you specified (e.g. @@ -17,19 +18,30 @@ multiple ways, offering a lot of flexibility: > **Remember**: If you do not specify the `--config` argument, the program will look for `trash.yml` > in the same directory where the executable lives. -## YAML Reference +# YAML Reference + +Table of Contents + +- [Sonarr](#sonarr) + - [Basic Settings](#basic-settings) + - [Quality Definition Settings](#quality-definition-settings) + - [Release Profile Settings](#release-profile-settings) +- [Radarr](#radarr) + - [Basic Settings](#basic-settings-1) + - [Quality Definition Settings](#quality-definition-settings-1) + - [Custom Format Settings](#custom-format-settings) -### Sonarr +## Sonarr ```yml sonarr: - base_url: http://localhost:8989 api_key: f7e74ba6c80046e39e076a27af5a8444 - # Quality definitions from the guide to sync to Sonarr. + # Quality Definition Settings quality_definition: hybrid - # Release profiles from the guide to sync to Sonarr. + # Release Profile Settings release_profiles: - type: anime strict_negative_scores: true @@ -43,94 +55,189 @@ sonarr: - tv ``` -- `base_url` (Required)
+### Basic Settings + +- `base_url` **(Required)**
The base URL of your Sonarr instance. Basically this is the URL you bookmark to get to the front page. -- `api_key` (Required)
+- `api_key` **(Required)**
The API key that Trash Updater should use to synchronize settings to your instance. You can obtain your API key by going to `Sonarr > Settings > General` and copy & paste the "API Key" under the "Security" group/header. -- `quality_definition` (Optional)
+### Quality Definition Settings + +- `quality_definition` (Optional; *Default: No quality definitions are synced*)
The quality definition [from the TRaSH Guide's Quality Settings page][sonarr_quality] that should be parsed and uploaded to Sonarr. Only the below values are permitted here. - - `anime`: Represents the "Sonarr Quality Definitions" table specifically for Anime - - `series`: Represents the "Sonarr Quality Definitions" table intended for normal TV Series. + - `anime` Represents the "Sonarr Quality Definitions" table specifically for Anime + + - `series` Represents the "Sonarr Quality Definitions" table intended for normal TV Series. Sometimes referred to as non-anime. - - `hybrid`: A combination of both the `anime` and `series` tables that is calculated by comparing + + - `hybrid` A combination of both the `anime` and `series` tables that is calculated by comparing each row and taking both the smallest minimum and largest maximum values. The purpose of the Hybrid type is to build the most permissive quality definition that the guide will allow. It's a good idea to use this one if you want more releases to be blocked by your release profiles instead of quality. -- `release_profiles` (Optional)
+[sonarr_quality]: https://trash-guides.info/Sonarr/V3/Sonarr-Quality-Settings-File-Size/ + +### Release Profile Settings + +- `release_profiles` (Optional; *Default: No release profiles are synced*)
A list of release profiles to parse from the guide. Each object in this list supports the below properties. - - `type` (Required): Must be one of the following values: + - `type` **(Required)**
+ Must be one of the following values: + - `anime`: Parse the [Anime Release Profile][sonarr_profile_anime] page from the TRaSH Guide. - `series`: Parse the [WEB-DL Release Profile][sonarr_profile_series] page from the TRaSH Guide. - - `strict_negative_scores` (Optional): Enables preferred term scores less than 0 to be instead - treated as "Must Not Contain" (ignored) terms. For example, if something is "Preferred" with a - score of `-10`, it will instead be put in the "Must Not Contains" section of the uploaded - release profile. Must be `true` or `false`. The default value is `false` if omitted. + - `strict_negative_scores` (Optional; *Default: `false`*)
+ Enables preferred term scores less than 0 to be instead treated as "Must Not Contain" (ignored) + terms. For example, if something is "Preferred" with a score of `-10`, it will instead be put in + the "Must Not Contains" section of the uploaded release profile. Must be `true` or `false`. - - `tags` (Optional): A list of one or more strings representing tags that will be applied to this - release profile. Tags are created in Sonarr if they do not exist. All tags on an existing - release profile (if present) are removed and replaced with only the tags in this list. If no - tags are specified, no tags will be set on the release profile. + - `tags` (Optional; *Default: Empty list*)
+ A list of one or more strings representing tags that will be applied to this release profile. + Tags are created in Sonarr if they do not exist. All tags on an existing release profile (if + present) are removed and replaced with only the tags in this list. If no tags are specified, no + tags will be set on the release profile. - - `filter` (Optional): Defines various ways that release profile terms from the guide are - synchronized with Sonarr. Any combination of the below properties may be specified here: - - `include_optional`: Set to `true` to include terms marked "Optional" in the guide. By default, - optional terms are *not* synchronized to Sonarr. The default is `false`. + - `filter` (Optional; *Default: Determined by child properties*)
+ Defines various ways that release profile terms from the guide are synchronized with Sonarr. Any + combination of the below properties may be specified here: + + - `include_optional` (Optional; *Default: `false`*)
+ Set to `true` to include terms marked "Optional" in the guide. If set to `false`, optional + terms are *not* synchronized to Sonarr. -[sonarr_quality]: https://trash-guides.info/Sonarr/V3/Sonarr-Quality-Settings-File-Size/ [sonarr_profile_anime]: https://trash-guides.info/Sonarr/V3/Sonarr-Release-Profile-RegEx-Anime/ [sonarr_profile_series]: https://trash-guides.info/Sonarr/V3/Sonarr-Release-Profile-RegEx/ -### Radarr +## Radarr ```yml radarr: - base_url: http://localhost:7878 api_key: bf99da49d0b0488ea34e4464aa63a0e5 - # Which quality definition in the guide to sync to Radarr. + # Quality Definition Settings quality_definition: type: movie preferred_ratio: 0.5 + + # Custom Format Settings + delete_old_custom_formats: false + custom_formats: + - names: + - BR-DISK + - EVO (no WEB-DL) + - LQ + - x265 (720/1080p) + - 3D + quality_profiles: + - name: HD-1080p + - name: HD-720p2 + score: -1000 + - names: + - TrueHD ATMOS + - DTS X + quality_profiles: + - name: SD ``` -- `base_url` (Required)
+### Basic Settings + +- `base_url` **(Required)**
The base URL of your Radarr instance. Basically this is the URL you bookmark to get to the front page. -- `api_key` (Required)
+- `api_key` **(Required)**
The API key that Trash Updater should use to synchronize settings to your instance. You can obtain your API key by going to `Radarr > Settings > General` and copy & paste the "API Key" under the "Security" group/header. -- `quality_definition` (Optional)
+### Quality Definition Settings + +- `quality_definition` (Optional; *Default: No quality definitions are synced*)
Specify information related to Radarr quality definition processing here. Only the following child properties are permitted. - - `type` (Required): The quality definition from the [Radarr Quality Settings (File - Size)][radarr_quality] page in the TRaSH Guides that should be parsed and uploaded to Radarr. - Only the below values are permitted here. + - `type` **(Required)**
+ The quality definition from the [Radarr Quality Settings (File Size)][radarr_quality] page in + the TRaSH Guides that should be parsed and uploaded to Radarr. Only the below values are + permitted here. - `movie`: Currently the only supported type. Represents the only table on that page and is intended for general use with all movies in Radarr. - - `preferred_ratio` (Optional) A value `0.0` to `1.0` that represents the percentage - (interpolated) position of that middle slider you see when you enable advanced settings on the - Quality Definitions page in Radarr. A value of `0.0` means the preferred quality will match the - minimum quality. Likewise, `1.0` will match the maximum quality. A value such as `0.5` will keep - it halfway between the two. + - `preferred_ratio` (Optional; *Default: `1.0`*)
+ A value `0.0` to `1.0` that represents the percentage (interpolated) position of that middle + slider you see when you enable advanced settings on the Quality Definitions page in Radarr. A + value of `0.0` means the preferred quality will match the minimum quality. Likewise, `1.0` will + match the maximum quality. A value such as `0.5` will keep it halfway between the two. - If not specified, the default value is `1.0`. Any value less than `0` or greater than `1` will - result in a warning log printed and the value will be clamped. + Any value less than `0` or greater than `1` will result in a warning log printed and the value + will be clamped. [radarr_quality]: https://trash-guides.info/Radarr/V3/Radarr-Quality-Settings-File-Size/ + +### Custom Format Settings + +For details on the way Custom Formats are synchronized to Radarr, visit the [[Custom Format +Synchronization]] page. + +- `delete_old_custom_formats` (Optional; *Default: `false`*)
+ If enabled, custom formats that you remove from your YAML configuration OR that are removed from + the guide will be deleted from your Radarr instance. Note that this *only* applies to custom + formats that Trash Updater has synchronized to Radarr. Custom formats that you have added manually + in Radarr **will not be deleted** if you enable this setting. + +- `custom_formats` (Optional; *Default: No custom formats are synced*)
+ A list of one or more sets of custom format names, each with an optional set of quality profiles + names that identify which quality profiles to assign the scores for those custom formats to. The + child properties documented below apply to each element of this list. + + - `names` **(Required)**
+ A list of one or more custom format names to synchronize to Radarr. The names *must* be taken + from the JSON itself in the guide, for example: + + ```json + { + "trash_id": "496f355514737f7d83bf7aa4d24f8169", + "name": "TrueHD ATMOS", + "includeCustomFormatWhenRenaming": false + } + ``` + + You take the value of `"name"` above and add it to the list of names like so: + + ```yml + names: + - TrueHD ATMOS + ``` + + > **A Few Things to Remember** + > + > - If `delete_old_custom_formats` is set to true, custom formats are **deleted** in Radarr if + > you remove them from this list. + > - It's OK for the same custom format to exist in multiple lists of `names`. Trash Updater will + > only ever synchronize it once. Allowing it to be specified multiple times allows you to + > assign it to different profiles with different scores. + + - `quality_profiles` (Optional; *Default: No quality profiles are changed*)
+ One or more quality profiles to update with the scores from the custom formats listed above. + Scores are taken from the guide by default, with an option to override the score for all of + them. Each object in the list must use the properties below. + + - `name` **(Required)**
+ The name of one of the quality profiles in Radarr. + + - `score` (Optional; *Default: Use scores from the guide*)
+ A positive or negative number representing the score to apply to *all* custom formats listed + in the `names` list. A score of `0` is also acceptable, which effectively disables the custom + formats without having to delete them. diff --git a/wiki/Custom-Format-Synchronization.md b/wiki/Custom-Format-Synchronization.md new file mode 100644 index 00000000..1ef20da4 --- /dev/null +++ b/wiki/Custom-Format-Synchronization.md @@ -0,0 +1,41 @@ +Custom format synchronization is broken up into three categories: + +- Creation: Custom formats that are in the guide but do not exist in Radarr are **created**. +- Updates: Custom formats that already exist in both the guide and in Radarr are **updated**. +- Deletions: If deletions are allowed by having the `delete_old_custom_formats` configuration + setting set to `true`, then custom formats in Radarr are deleted if they are removed from the + guide **or** removed from your configuration file. + +> **Important** +> +> Trash Updater will *never* touch custom formats that you create by hand, unless they share a name +> with a custom format in the guide. In general, Trash Updater must have been the one to create a +> custom format in order to do anything to it (update or delete). + +## Cache + +### Summary + +The synchronization cache in Trash Updater allows it to more accurately detect changes to custom +formats in the TRaSH guides. This mainly helps cover changes like renames. + +Once Trash Updater creates or updates a custom format in Radarr, it records information about it in +a cache file located on disk. The location varies depending on platform: + +- Windows: `%APPDATA%/trash-updater/cache` +- Linux: `~/.config/trash-updater/cache` +- MacOS: `~/Library/Application Support/trash-updater/cache` + +The cache files are not meant to be edited by users. In general I recommend leaving them alone. +Trash Updater will manage it for you. However, sometimes a bug may cause an issue where deleting the +cache directory will be a good way to recover. + +### Custom Format Identification Behavior + +The cache stores and remembers the last known valid name for a custom format. If a custom format +gets renamed in the Trash Guide, you don't need to immediately rename it in your YAML config. Trash +Updater will issue a warning in console output when the names become outdated. This gives you plenty +of time to fix the issue. + +Note that if the cache gets deleted, custom formats with outdated names will no longer synchronize +to Radarr and you will need to either remove it or fix the name.