diff --git a/CHANGELOG b/CHANGELOG index cf959bba..98c45911 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ Added Spanish Defaults Translation Added Delete Webhooks # Bug Fixes +Fixes #1187 Franchise Defaults no longer ignore collection_section and sort_title Fixed Italian Defaults Translation Fixed TMDb Modified Filters Fixed ValueError from Anime IDs \ No newline at end of file diff --git a/VERSION b/VERSION index 252f36cb..0575d8b0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.2-develop7 +1.18.2-develop8 diff --git a/defaults/movie/franchise.yml b/defaults/movie/franchise.yml index 92ef4fed..545e5ef1 100644 --- a/defaults/movie/franchise.yml +++ b/defaults/movie/franchise.yml @@ -27,12 +27,10 @@ templates: collection_order_<>: <> optional: - summary_<> - - name_<> - movie - name_mapping - build_collection - collection_mode - - collection_order - collection_section - radarr_add_missing - radarr_folder @@ -41,7 +39,6 @@ templates: - radarr_monitor - url_poster_<> summary: <>>> - name: <>>> cache_builders: 1 minimum_items: <> url_poster: <>>> diff --git a/defaults/show/franchise.yml b/defaults/show/franchise.yml index 902dd068..eb631d7a 100644 --- a/defaults/show/franchise.yml +++ b/defaults/show/franchise.yml @@ -28,7 +28,6 @@ templates: url_poster_<>: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-Images/master/franchise/<>.jpg optional: - summary_<> - - name_<> - name_mapping - sort_title - build_collection @@ -41,7 +40,6 @@ templates: - item_sonarr_tag - sonarr_monitor summary: <>>> - name: <>>> minimum_items: <> tmdb_show: <> url_poster: <>>> diff --git a/docs/defaults/movie/franchise.md b/docs/defaults/movie/franchise.md index 0ee464c9..b3230a4e 100644 --- a/docs/defaults/movie/franchise.md +++ b/docs/defaults/movie/franchise.md @@ -35,7 +35,6 @@ Note that the `template_variables:` section only needs to be used if you do want | Variable | Description & Values | |:-----------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `name_<>`1 | **Description:** Changes the name of the specified key's collection.
**Values:** New Collection Name | | `summary_<>`1 | **Description:** Changes the summary of the specified key's collection.
**Values:** New Collection Summary | | `collection_section` | **Description:** Adds a sort title with this collection sections.
**Values:** Any number | | `order_<>`1 | **Description:** Controls the sort order of the collections in their collection section.
**Values:** Any number | diff --git a/docs/defaults/show/franchise.md b/docs/defaults/show/franchise.md index 5fd0808a..96965adc 100644 --- a/docs/defaults/show/franchise.md +++ b/docs/defaults/show/franchise.md @@ -35,7 +35,6 @@ Note that the `template_variables:` section only needs to be used if you do want | Variable | Description & Values | |:-----------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `name_<>`1 | **Description:** Changes the name of the specified key's collection.
**Values:** New Collection Name | | `summary_<>`1 | **Description:** Changes the summary of the specified key's collection.
**Values:** New Collection Summary | | `collection_section` | **Description:** Adds a sort title with this collection sections.
**Values:** Any number | | `order_<>`1 | **Description:** Controls the sort order of the collections in their collection section.
**Values:** Any number | diff --git a/modules/meta.py b/modules/meta.py index 6daef5ab..54c0e192 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -468,7 +468,7 @@ class DataFile: logger.trace(f"Translation: {translation_variables}") logger.trace("") - def check_for_var(_method, _data): + def check_for_var(_method, _data, _debug): def scan_text(og_txt, var, actual_value): if og_txt is None: return og_txt @@ -478,9 +478,13 @@ class DataFile: return str(og_txt).replace(f"<<{var}>>", str(actual_value)) else: return og_txt + if _debug: + logger.trace(f"Start {_method}: {_data}") for i_check in range(8): for option in optional: if option not in variables and option not in translation_variables and f"<<{option}>>" in str(_data): + if _debug: + logger.trace(f"Failed {_method}: {_data}") raise Failed for variable, variable_data in variables.items(): if (variable == "collection_name" or variable == "playlist_name") and _method in ["radarr_tag", "item_radarr_tag", "sonarr_tag", "item_sonarr_tag"]: @@ -491,14 +495,16 @@ class DataFile: _data = scan_text(_data, variable, variable_data) for dm, dd in default.items(): _data = scan_text(_data, dm, dd) + if _debug: + logger.trace(f"End {_method}: {_data}") return _data - def check_data(_method, _data): + def check_data(_method, _data, _debug): if isinstance(_data, dict): final_data = {} for sm, sd in _data.items(): try: - final_data[check_for_var(_method, sm)] = check_data(_method, sd) + final_data[check_for_var(_method, sm, _debug)] = check_data(_method, sd, _debug) except Failed: continue if not final_data: @@ -507,24 +513,25 @@ class DataFile: final_data = [] for li in _data: try: - final_data.append(check_data(_method, li)) + final_data.append(check_data(_method, li, _debug)) except Failed: continue if not final_data: raise Failed else: - final_data = check_for_var(_method, _data) + final_data = check_for_var(_method, _data, _debug) return final_data for method_name, attr_data in template.items(): if method_name not in data and method_name not in ["default", "optional", "conditionals", "move_collection_prefix", "move_prefix"]: try: - new_name = check_for_var(method_name, method_name) + debug_template = False + new_name = check_for_var(method_name, method_name, debug_template) if new_name in new_attributes: logger.info("") logger.warning(f"Template Warning: template attribute: {new_name} from {variables['name']} skipped") else: - new_attributes[new_name] = check_data(new_name, attr_data) + new_attributes[new_name] = check_data(new_name, attr_data, debug_template) except Failed: continue logger.separator(f"Final Template Attributes", space=False, border=False, debug=True)