[9] #793 Fixed KeyError

pull/811/head
meisnate12 3 years ago
parent a7bf1e54ff
commit e5f0bea8d6

@ -1 +1 @@
1.16.2-develop8 1.16.2-develop9

@ -23,10 +23,10 @@ radarr:
plex_path: /share/CACHEDEV1_DATA/Multimedia plex_path: /share/CACHEDEV1_DATA/Multimedia
``` ```
| Attribute | Allowed Values | Default | Required | | Attribute | Allowed Values | Default | Required |
|:-------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------:|:--------:| |:-------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------:|:--------:|
| `url` | Radarr URL (Including URL Base if set).<br>**Example:** http://192.168.1.12:32788 | N/A | &#9989; | | `url` | Radarr URL (Including URL Base if set).<br>**Example:** http://192.168.1.12:32788 | N/A | &#9989; |
| `token` | Radarr API Token. | N/A | &#9989; | | `token` | Radarr API Token. | N/A | &#9989; |
| `add_missing` | Adds all missing movies found from all collections to Radarr.<br>Use the `radarr_add_missing` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to add missing per collection.<br>**boolean:** true or false | false | &#10060; | | `add_missing` | Adds all missing movies found from all collections to Radarr.<br>Use the `radarr_add_missing` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to add missing per collection.<br>**boolean:** true or false | false | &#10060; |
| `add_existing` | Adds all existing movies in collections to Radarr.<br>Use the `radarr_add_existing` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to add existing per collection.<br>**boolean:** true or false | false | &#10060; | | `add_existing` | Adds all existing movies in collections to Radarr.<br>Use the `radarr_add_existing` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to add existing per collection.<br>**boolean:** true or false | false | &#10060; |
| `root_folder_path` | Default Root Folder Path to use when adding new movies.<br>Use the `radarr_folder` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the Root Folder per collection. | N/A | &#9989; | | `root_folder_path` | Default Root Folder Path to use when adding new movies.<br>Use the `radarr_folder` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the Root Folder per collection. | N/A | &#9989; |
@ -35,8 +35,8 @@ radarr:
| `quality_profile` | Default Quality Profile to use when adding new movies.<br>Use the `radarr_quality` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the Quality Profile per collection. | N/A | &#10060; | | `quality_profile` | Default Quality Profile to use when adding new movies.<br>Use the `radarr_quality` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the Quality Profile per collection. | N/A | &#10060; |
| `tag` | Default this list or comma-separated string of tags to use when adding new movies.<br>Use the `radarr_tag` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the Tags per collection. | ` ` | &#10060; | | `tag` | Default this list or comma-separated string of tags to use when adding new movies.<br>Use the `radarr_tag` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the Tags per collection. | ` ` | &#10060; |
| `search` | Start search for missing movie when adding new movies.<br>Use the `radarr_search` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the search value per collection.<br>**boolean:** true or false | false | &#10060; | | `search` | Start search for missing movie when adding new movies.<br>Use the `radarr_search` [Radarr Details](../metadata/details/arr.md#radarr-details) in the collection definition to set the search value per collection.<br>**boolean:** true or false | false | &#10060; |
| `plex_path` | When using `add_existing` or `radarr_add_all` Convert this part of the path to `radarr_path`. | ` ` | &#10060; | | `plex_path` | When using `add_existing` or `radarr_add_all` Convert this part of the path to `radarr_path`. | ` ` | &#10060; |
| `radarr_path` | When using `add_existing` or `radarr_add_all` Convert the `plex_path` part of the path to this. | ` ` | &#10060; | | `radarr_path` | When using `add_existing` or `radarr_add_all` Convert the `plex_path` part of the path to this. | ` ` | &#10060; |
* The `token` can be found by going to `Radarr > Settings > General > Security > API Key` * The `token` can be found by going to `Radarr > Settings > General > Security > API Key`

@ -26,10 +26,10 @@ sonarr:
plex_path: /share/CACHEDEV1_DATA/Multimedia plex_path: /share/CACHEDEV1_DATA/Multimedia
``` ```
| Attribute | Allowed Values | Default | Required | | Attribute | Allowed Values | Default | Required |
|:-------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------:|:--------:| |:-------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------:|:--------:|
| `url` | Sonarr URL (Including URL Base if set).<br>**Example:** http://192.168.1.12:32788 | N/A | &#9989; | | `url` | Sonarr URL (Including URL Base if set).<br>**Example:** http://192.168.1.12:32788 | N/A | &#9989; |
| `token` | Sonarr API Token. | N/A | &#9989; | | `token` | Sonarr API Token. | N/A | &#9989; |
| `add_missing` | Adds all missing shows found from all collections to Sonarr.<br>Use the `sonarr_add_missing` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to add missing per collection.<br>**boolean:** true or false | false | &#10060; | | `add_missing` | Adds all missing shows found from all collections to Sonarr.<br>Use the `sonarr_add_missing` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to add missing per collection.<br>**boolean:** true or false | false | &#10060; |
| `add_existing` | Adds all existing shows in collections to Sonarr.<br>Use the `sonarr_add_existing` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to add existing per collection.<br>**boolean:** true or false | false | &#10060; | | `add_existing` | Adds all existing shows in collections to Sonarr.<br>Use the `sonarr_add_existing` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to add existing per collection.<br>**boolean:** true or false | false | &#10060; |
| `root_folder_path` | Default Root Folder Path to use when adding new shows.<br>Use the `sonarr_folder` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the Root Folder per collection. | N/A | &#9989; | | `root_folder_path` | Default Root Folder Path to use when adding new shows.<br>Use the `sonarr_folder` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the Root Folder per collection. | N/A | &#9989; |
@ -41,8 +41,8 @@ sonarr:
| `tag` | Default this list or comma-separated string of tags to use when adding new shows.<br>Use the `sonarr_tag` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the tags per collection. | ` ` | &#10060; | | `tag` | Default this list or comma-separated string of tags to use when adding new shows.<br>Use the `sonarr_tag` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the tags per collection. | ` ` | &#10060; |
| `search` | Start search for missing episodes when adding new shows.<br>Use the `sonarr_search` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the search value per collection.<br>**boolean:** true or false | false | &#10060; | | `search` | Start search for missing episodes when adding new shows.<br>Use the `sonarr_search` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the search value per collection.<br>**boolean:** true or false | false | &#10060; |
| `cutoff_search` | Start search for cutoff unmet episodes when adding new shows.<br>Use the `sonarr_cutoff_search` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the cutoff search value per collection.<br>**boolean:** true or false | false | &#10060; | | `cutoff_search` | Start search for cutoff unmet episodes when adding new shows.<br>Use the `sonarr_cutoff_search` [Sonarr Details](../metadata/details/arr.md#sonarr-details) in the collection definition to set the cutoff search value per collection.<br>**boolean:** true or false | false | &#10060; |
| `plex_path` | When using `add_existing` or `sonarr_add_all` Convert this part of the path to `sonarr_path`. | ` ` | &#10060; | | `plex_path` | When using `add_existing` or `sonarr_add_all` Convert this part of the path to `sonarr_path`. | ` ` | &#10060; |
| `sonarr_path` | When using `add_existing` or `sonarr_add_all` Convert the `plex_path` part of the path to this. | ` ` | &#10060; | | `sonarr_path` | When using `add_existing` or `sonarr_add_all` Convert the `plex_path` part of the path to this. | ` ` | &#10060; |
* The `token` can be found by going to `Sonarr > Settings > General > Security > API Key` * The `token` can be found by going to `Sonarr > Settings > General > Security > API Key`

@ -694,24 +694,25 @@ class MetadataFile(DataFile):
if self.library.edit_item(item, mapping_name, self.library.type, edits): if self.library.edit_item(item, mapping_name, self.library.type, edits):
updated = True updated = True
advance_edits = {} if self.library.type in util.advance_tags_to_edit:
prefs = [p.id for p in item.preferences()] advance_edits = {}
for advance_edit in util.advance_tags_to_edit[self.library.type]: prefs = [p.id for p in item.preferences()]
if advance_edit in methods: for advance_edit in util.advance_tags_to_edit[self.library.type]:
if advance_edit in ["metadata_language", "use_original_title"] and self.library.agent not in plex.new_plex_agents: if advance_edit in methods:
logger.error(f"Metadata Error: {advance_edit} attribute only works for with the New Plex Movie Agent and New Plex TV Agent") if advance_edit in ["metadata_language", "use_original_title"] and self.library.agent not in plex.new_plex_agents:
elif meta[methods[advance_edit]]: logger.error(f"Metadata Error: {advance_edit} attribute only works for with the New Plex Movie Agent and New Plex TV Agent")
key, options = plex.item_advance_keys[f"item_{advance_edit}"] elif meta[methods[advance_edit]]:
method_data = str(meta[methods[advance_edit]]).lower() key, options = plex.item_advance_keys[f"item_{advance_edit}"]
if method_data not in options: method_data = str(meta[methods[advance_edit]]).lower()
logger.error(f"Metadata Error: {meta[methods[advance_edit]]} {advance_edit} attribute invalid") if method_data not in options:
elif key in prefs and getattr(item, key) != options[method_data]: logger.error(f"Metadata Error: {meta[methods[advance_edit]]} {advance_edit} attribute invalid")
advance_edits[key] = options[method_data] elif key in prefs and getattr(item, key) != options[method_data]:
logger.info(f"Detail: {advance_edit} updated to {method_data}") advance_edits[key] = options[method_data]
else: logger.info(f"Detail: {advance_edit} updated to {method_data}")
logger.error(f"Metadata Error: {advance_edit} attribute is blank") else:
if self.library.edit_item(item, mapping_name, self.library.type, advance_edits, advanced=True): logger.error(f"Metadata Error: {advance_edit} attribute is blank")
updated = True if self.library.edit_item(item, mapping_name, self.library.type, advance_edits, advanced=True):
updated = True
for tag_edit in util.tags_to_edit[self.library.type]: for tag_edit in util.tags_to_edit[self.library.type]:
if self.edit_tags(tag_edit, item, meta, methods, extra=genres if tag_edit == "genre" else None): if self.edit_tags(tag_edit, item, meta, methods, extra=genres if tag_edit == "genre" else None):

Loading…
Cancel
Save