presets:

  # assumes that each entry is a song in one album
  _albums_from_playlists:
    preset:
      - "_music_base"
      - "_multi_url"

    overrides:
      include_sibling_metadata: True

      track_album: "{playlist_title}"
      track_number: "{playlist_index}"
      track_number_padded: "{playlist_index_padded}"
      track_total: "{playlist_count}"
      track_year: "{playlist_max_upload_year}"

  "YouTube Releases":
    preset:
      - "_albums_from_playlists"
      - "_throttle_protection"

  "Bandcamp":
    preset:
      - "_albums_from_playlists"
    overrides:
      # Captures 'Some - Song' from 'Emily Hopkins - Some - Song'
      captured_track_title: >-
        {
          %regex_capture_many(
            title,
            [ ".*? - (.*)" ],
            [ title ]
          )
        }
      track_title: "{%array_at(captured_track_title, 1)}"
