metadata:
{%- for item in items %}
    {%- set itemTitleFull = item.metadata | formatItemTitle %}
    {%- set itemTitleShort = item.metadata | formatItemTitle(False, False) %}
    {#- title: {{ item.metadata.title }}
    # itemTitleFull: {{ itemTitleFull }}
    # itemTitleShort: {{ itemTitleShort }} #}
    "{{ itemTitleFull }}":
        year: {{ item.metadata.year }}
        title: "{{ item.metadata.title }}"
        {%- if itemTitleShort != item.metadata.title  %}
        alt_title: "{{ itemTitleShort }}"{% endif %}
        {%- if item.metadata.originalTitle and itemTitleFull != item.metadata.originalTitle %}
        orig_title: "{{ item.metadata.originalTitle }}"{% endif %}
        {%- if item.metadata.titleSort and item.metadata.titleSort != item.metadata.title %}
        sort_title: "{{ item.metadata.titleSort }}"{% endif %}
        {%- if item.metadata.editionTitle and item.metadata.editionTitle | length > 0 %}
        edition_filter: {{ item.metadata.editionTitle }}{% endif %}
        {% if not item.pmm.poster %}# {% endif %}url_poster: {{ item.pmm.poster | default(settings.thePosterDatabase.dbAssetUrl, True) }}
        # IDs: {{ item.metadata.guids | map(attribute="id") | list | join(', ')}}
        # tpdb: {{ item.metadata | generateTpDbSearchUrl }}
        # tmdb: {% if item.metadata | getItemGuidByName("tmdb") | default("") | length > 0 %}https://www.themoviedb.org/{% if item.metadata.type == "movie" %}movie{% elif item.metadata.type == "show" %}tv{% else %}{% endif %}/{{ item.metadata | getItemGuidByName("tmdb") }}{% endif %}
        # tvdb: {% if item.metadata | getItemGuidByName("tvdb") | default("") | length > 0 %}https://thetvdb.com/search?menu%5Btype%5D={% if item.metadata.type == "movie"%}movie{% elif item.metadata.type == "show" %}series{% else %}{% endif %}&menu%5Byear%5D={{ item.metadata.year }}&query={{ item.metadata | getItemGuidByName("tvdb") }}{% endif %}
        # imdb: {% if item.metadata | getItemGuidByName("imdb") | default("") | length > 0 %}https://www.imdb.com/title/{{ item.metadata | getItemGuidByName("imdb") }}{% endif %}
{% endfor %}

{#- 
########################################################################################################################
########################################################################################################################

external_templates:
  pmm: templates
  
templates:
  tplCommonBase:
    optional:
      - poster
    move_prefix: The
    sync_mode: sync
    url_poster: <<poster>>

  tplCommonItem:
    default:
      sort_prefix: ""
      sort_order: ""
      sort_separator: ""
    sort_title: <<sort_prefix>><<sort_separator>><<sort_order>><<sort_separator>><<title>>

  tplCommonCollection:
    default:
      sort_prefix: ""
      sort_order: ""
      sort_separator: ""
    collection_order: release
    sort_title: <<sort_prefix>><<sort_separator>><<sort_order>><<sort_separator>><<collection_name>>

  tplTVDBCollection:
    optional:
      - list
      - show
      - movie
    tvdb_show: <<show>>
    tvdb_show_details: <<show>>
    tvdb_list: https://www.thetvdb.com/lists/<<list>>
    tvdb_list_details: https://www.thetvdb.com/lists/<<list>>
    tvdb_movie: <<movie>>
    tvdb_movie_details: <<movie>>

  tplTMDBCollection:
    optional:
      - collection
      - list
      - show
    tmdb_collection: <<collection>>
    tmdb_collection_details: <<collection>>
    tmdb_list: <<list>>
    tmdb_list_details: <<list>>
    tmdb_show: <<show>>
    tmdb_show_details: <<show>>
#}