# ------------------------------------------------------------------------------------ #
#                                      BEETS CONFIG                                    #
# ------------------------------------------------------------------------------------ #

directory: ~/haos_media/music
library: ~/.config/beets/library.db

asciify_paths: no
threaded: yes
per_disc_numbering: no
duplicate_verbose_prompt : yes
artist_credit : yes

# import settings, check https://beets.readthedocs.io/en/stable/reference/config.html#importer-options
import:
  write: yes                        # if yes, write metadata into the files.
  copy: no                          # if yes, copy files into the Beets library directory.
  move: no                          # if yes, ignore copy and move files into the Beets library directory. if both copy and move are no, it will write metadata into the files.
  quiet: yes                        # if yes, skip silently when importer is unsure (it will use the match section to proceed). If no, ask for a manual decision from the user.
  quiet_fallback: skip              # (requires quiet: yes), if skip, skip files that are already in the library
  timid: no                        # if yes, ask for confirmation on every autotagging match, even the ones that seem very close. Needs quiet to be 'no'
  autotag: yes                      # if yes, enable autotagging (will apply metadata to files automatically) Needs  “timid” mode to be 'no'
  duplicate_action: remove          # remove duplicate files
  incremental: no                  # if yes, don't reimport albums already imported
  incremental_skip_later: yes       # if yes, don't reimport an album/track that was skipped
  resume: ask                       # Resume interrupted imports?
  pretend: no                      # if yes, don't write metadata into the files. Run in pretend mode.
  none_rec_action: asis            # what should happen during an interactive import session when there is no recommendation.


match: # Used by Autotagging
  strong_rec_thresh: 0.05           # Strong recommendation > 95%.  Accepted automatically if distance < strong_rec_thresh (except in “timid” mode)
  medium_rec_thresh: 0.3            # Medium recommendation. Suggest a track if its distance < medium threshold (works when quiet mode is disabled)
  track_length_grace: 2            # Allow up to 2 seconds difference without penalty
  track_length_max: 10              # Cap maximum penalty at 5 seconds difference.
  distance_weights:
    data_source: 0.0
    missing_tracks: 0.0 # ignore missing tracks in the distance weights
    explicit: 0.0
    country: 0.0
    media: 0.0
    tracks: 2.5
    track_title: 4.0
    track_index: 4.0
    track_length: 2.0
    track_artist: 5.0
    unmatched_tracks: 0.0


#  preferred:                        # Put these at the top of recommendations
#    countries: [XW, US, GB|UK,FR]   # Favorite music publishing countries
#    media: [CD, Digital Media|File] # Favorite music sources
#  ignored: track_length             # Ignore tracks that don't have the same length

ui:
  color: yes
  colors:
    text_success: green
    text_warning: yellow
    text_error: red
    text_highlight: red
    text_highlight_minor: lightgray
    action_default: turquoise
    action: blue
  length_diff_thresh: 1.0



plugins:
  - musicbrainz
  - fetchart
  - embedart
  - lastgenre # tags albums and tracks
  - ftintitle # featured artists in title
  - duplicates
  #  - missing
  - mbsync
  - info
  - fromfilename
  #  - chroma
  - titlecase

# ------------------------------------------------------------------------------------ #
# PATH CLEANING
# ------------------------------------------------------------------------------------ #

replace:
  '[\\]': ""
  "[_]": "-"
  "[/]": "-"
  '^\.+': ""
  '[\x00-\x1f]': ""
  '[<>:"\?\*\|]': ""
  '\.$': ""
  '\s+$': ""
  '^\s+': ""
  "^-": ""
  "’": ""
  "′": ""
  "″": ""
  "‐": "-"



# This plugin overrides musicbrainz default naming
titlecase:
  auto: yes
  all_caps: yes # if a word is in capital letters, don't change it
  fields:
    - title # apply on title
    - album # apply on album
  preserve: # Don't change the capitalization of these words
    - "A"
    - "An"
    - "The"
    - "And"
    - "But"
    - "Or"
    - "Nor"
    - "For"
    - "So"
    - "Yet"
    - "At"
    - "By"
    - "In"
    - "Of"
    - "On"
    - "To"
    - "Up"
    - "As"
    - "Per"
    - "Via"
    - "With"
    - "From"
    - "Into"
    - "Over"
    - "Upon"
    - "Off"
    - "Out"
    - "Around"
    - "About"
    - "Before"
    - "After"
    - "Under"
    - "Between"
    - "Without"
# ------------------------------------------------------------------------------------ #
# COVER ART
# ------------------------------------------------------------------------------------ #

fetchart:
  minwidth: 500
  enforce_ratio: yes
  sources: coverart itunes filesystem

embedart:
  auto: yes
  ifempty: yes # only embedded cover art if missing
  remove_art_file: yes

# ------------------------------------------------------------------------------------ #
# FEATURED ARTISTS
# ------------------------------------------------------------------------------------ #

ftintitle:
  auto: yes
  drop: yes
  keep_in_artist: yes

# ------------------------------------------------------------------------------------ #
# GENRES (PER TRACK)
# ------------------------------------------------------------------------------------ #

lastgenre:
  auto: yes
  source: track
  count: 4
  prefer_specific: no
  separator: "; "

#chroma:
#  auto: yes

musicbrainz:
  extra_tags: [alias, year] # https://beets.readthedocs.io/en/stable/plugins/musicbrainz.html#conf-extra_tags
  search_limit: 7

duplicates:
  keys: [title, albumartist]
  tiebreak:
    items: [bitrate, added]
  delete: no
