##############################################################################
#                           Streaming Collections                            #
#                 Created by Yozora, Bullmoose20, & Sohjiro                  #
#          EDITING THIS FILE MAY CAUSE PULLING NEW UPDATES TO FAIL           #
#         https://metamanager.wiki/en/latest/defaults/both/streaming         #
##############################################################################

external_templates:
  pmm: templates
  template_variables:
    collection_section: "030"

templates:
  streaming:
    optional:
      - use_<<key>>
      - use_<<originals_key>>
      - allowed_libraries
      - originals_only
    conditionals:
      originals:
        conditions:
          - originals_only: true
            value: originals
      discover_limit:
        conditions:
          - originals_only: false
            value: <<limit>>
      discover_with:
        conditions:
          - originals_only: false
            value: <<key>>
      discover_region:
        conditions:
          - originals_only: false
            value: <<region>>
      allowed_streaming:
        conditions:
          - originals_only: true
            key: ["103", "1759", "151", "230", "283", "510", "39", "37", "188"]
            value: False
          - region.not: GB
            key: ["103", "151", "39"]
            value: False
          - region.not: CA
            key: ["230"]
            value: False
          - region: CA
            key: ["1899", "37"]
            value: False

    default:
      region: "US"
      limit: "500"
      sync_mode: sync
      sync_mode_<<key>>: <<sync_mode>>
      sort_by: release.desc
      sort_by_<<key>>: <<sort_by>>
    run_definition:
      - <<use_<<key>>>>
      - <<use_<<originals_key>>>>
      - <<allowed_libraries>>
      - <<allowed_streaming>>
    cache_builders: 1
    smart_label: <<sort_by_<<key>>>>
    sync_mode: <<sync_mode_<<key>>>>
    mdblist_list: https://mdblist.com/lists/plexmetamanager/<<originals_key>>-<<originals>>
    tmdb_discover:
      limit: <<discover_limit>>
      with_watch_providers: <<discover_with>>
      watch_region: <<discover_region>>

collections:
  Streaming Collections:
    template:
      - name: separator
        separator: streaming
        key_name: Streaming
        translation_key: separator

dynamic_collections:
  Streaming:
    type: custom
    data:
      103: All 4
      350: Apple TV+
      1759: BET+
      151: BritBox
      230: Crave
      283: Crunchyroll
      510: discovery+
      337: Disney+
      1899: Max
      223: hayu
      15: Hulu
      8: Netflix
      39: NOW
      531: Paramount+
      387: Peacock
      9: Prime Video
      37: Showtime
      188: YouTube
    title_format: <<key_name>> <<library_typeU>>s
    template:
      - streaming
      - shared
      - arr
    template_variables:
      image:
        default: streaming/<<key_name_encoded>>
      originals_key:
        103: all4
        350: appletv
        1759: bet
        151: britbox
        230: crave
        283: crunchyroll
        510: discovery
        337: disney
        1899: max
        223: hayu
        15: hulu
        8: netflix
        39: now
        531: paramount
        387: peacock
        9: amazon
        37: showtime
        188: youtube
      originals_only:
        default: false
      allowed_libraries:
        223: show
        510: show
        283: show
      translation_key:
        default: streaming
      dynamic:
        default: true