directory: /music
library: /config/musiclibrary.blb
pluginpath:
  - /config/beetsplug/
  - /config/beets-tcp/

# ----------------------------------------------------------------------------
# Import Options
# ----------------------------------------------------------------------------
threaded: yes
original_date: yes
per_disc_numbering: yes
ignore: [".*", "*~", "System Volume Information"]
clutter: ["Thumbs.DB", ".DS_Store", "Desktop.ini", ".AppleDouble"]

import:
    write: yes
    copy: no
    move: yes
    resume: yes
    incremental: no
    quiet_fallback: skip
    duplicate_action: keep
    timid: no
    log: /config/beet.log

# ----------------------------------------------------------------------------
# Plugins
# ----------------------------------------------------------------------------
plugins: scrub discogs missing lastgenre web inline albumtypes badfiles the filetote bucket mbsync tcp hook unimported

# ----------------------------------------------------------------------------
# Matching & Metadata
# ----------------------------------------------------------------------------
match:
    strong_rec_thresh: 0.07
    medium_rec_thresh: 0.25
    rec_gap_thresh: 0.25
    max_rec:
        missing_tracks: medium
        unmatched_tracks: medium
    distance_weights:
        source: 0.0
        artist: 3.0
        album: 3.0
        media: 1.0
        mediums: 1.0
        year: 0.0
        country: 0.5
        label: 0.5
        catalognum: 0.5
        albumdisambig: 0.5
        album_id: 5.0
        tracks: 0.0
        missing_tracks: 0.1
        unmatched_tracks: 0.6
        track_title: 3.0
        track_artist: 2.0
        track_index: 1.0
        track_length: 2.0
        track_id: 5.0
    preferred:
        countries: []
        media: []
        original_year: no
    ignored: [missing_tracks, unmatched_tracks]
    track_length_grace: 10
    track_length_max: 30

unimported:
    ignore_extensions: jpg png log cue m3u url pls pdf nfo txt zip 7z tif sfv m3u8 rtf JPG PNG srr accurip md5 MD5 bmp TXT psd jpeg 00J 00N 00S 00T alb auCDtect bat blb CDP cfp CUE DLL doc DXR EXE ffp gif html ICO IFO INF JA LOG lrc lst m4a MOV mpeg NFO old ps1 py QDAT sfk SFV sha sig st5 TIF tiff torrent txt webp X32 xmp yaml
    ignore_subdirectories: data scans log cue Data Scans

# ----------------------------------------------------------------------------
# Field Definitions (The Logic Center)
# ----------------------------------------------------------------------------
item_fields:
    # 1. Track Numbering (1.01 for multi-disc, 01. for single disc)
    disc_and_track: |
        if disctotal > 1:
            return u'%01i.%02i' % (disc, track)
        else:
            return u'%02i.' % (track)

    # 2. Identify "Various Artists" for path logic
    is_various: |
        if albumartist == 'Various Artists':
            return 1
        else:
            return 0

    # 3. Clean Folder Artist Name
    folderartist: |
        import re
        name = albumartist.strip()
        
        # --- 1. IMMEDIATE HANDLERS (Protection) ---
        if name == 'Various Artists':
            return 'Various Artists'

        # Protected Names: Return these EXACTLY before "With/And" stripping ruins them
        protected_names = [
            'Dance With the Dead', 
            'Captain Beefheart & His Magic Band',
            'Big Brother & the Holding Company',
            'Pizzicato Five',
            'DJ Jazzy Jeff & the Fresh Prince',
            'Bob Marley & The Wailers',
            'U.S. Music With Funkadelic',
            'Jem & the Holograms'
        ]
        if name in protected_names:
            return name

        # --- 2. ARTICLE HANDLING (The / A) ---
        suffix = ''
        name_lower = name.lower()
        
        if name_lower.startswith('the '):
            name = name[4:]
            suffix = ', The'
        elif name_lower.startswith('a '):
            name = name[2:]
            suffix = ', A'

        # --- 3. ARTIST MAPPING (Aliases & Specific Redirects) ---
        alias_groups = [
            # --- ASIAN ARTISTS ---
            (['2NE1', 'To Anyone', '2NE1 (투에니원)'], '2NE1 (투에니원)'),
            (['4minute', '4Minute', '포미닛'], '4minute (포미닛)'),
            (['Ami Suzuki', 'Suzuki Ami', '鈴木亜美'], 'Ami Suzuki (鈴木亜美)'),
            (['Angela Aki', 'Aki Angela', 'アンジェラ・アキ'], 'Angela Aki'),
            (['Anri', '杏里'], 'Anri (杏里)'),
            (['Asako Toki', 'Toki Asako', '土岐麻子'], 'Asako Toki (土岐麻子)'),
            (['Ayaka', '絢香'], 'Ayaka (絢香)'),
            (['Ayumi Hamasaki', 'Hamasaki Ayumi', '浜崎あゆみ'], 'Ayumi Hamasaki (浜崎あゆみ)'),
            (['BoA', '보아'], 'BoA (보아)'),
            (['capsule', 'capsule (カプセル)', 'CAPSULE', 'Capsule'], 'CAPSULE'),
            (['Chihiro Yonekura', 'Yonekura Chihiro', '米倉千尋'], 'Chihiro Yonekura (米倉千尋)'),
            (['Crystal Kay', 'Crystal Kay Loves M-FLO'], 'Crystal Kay'),
            (['DAISHI DANCE'], 'DAISHI DANCE'),
            (['Dai Hirai', 'Hirai Dai', '平井大'], 'Dai Hirai (平井大)'),
            (['Fantastic Plastic Machine', 'FPM', 'Tomoyuki Tanaka , Fantastic Plastic Machine'], 'Fantastic Plastic Machine'),
            (['Free Tempo', 'FreeTEMPO'], 'FreeTEMPO'),
            (['Girls\' Generation', 'SNSD', 'SoNyuhShiDae', '소녀시대'], 'Girls\' Generation (소녀시대)'),
            (['Hideki Kaji', 'Kaji Hideki', '加地秀基', 'Hideki Kaji (カジヒデキ)'], 'Hideki Kaji (加地秀基)'),
            (['Hiromi Uehara', 'Hiromi’s Sonicbloom', '上原ひろみ'], 'Hiromi Uehara (上原ひろみ)'),
            (['JUJU'], 'JUJU'),
            (['Junko Ohashi', 'Ohashi Junko', '大橋純子', '大橋純子&美乃家セントラル・ステイション'], 'Junko Ohashi (大橋純子)'),
            (['Kana Nishino', 'Nishino Kana', '西野カナ'], 'Kana Nishino (西野カナ)'),
            (['KARA', '카라'], 'KARA'),
            (['Kenichi Mitsuda', 'Mitsuda Kenichi', '光田健一'], 'Kenichi Mitsuda (光田健一)'),
            (['Koda Kumi', '倖田來未'], 'Koda Kumi (倖田來未)'),
            (['Kyary Pamyu Pamyu', 'きゃりーぱみゅぱみゅ'], 'Kyary Pamyu Pamyu'),
            (['Maaya Sakamoto', 'Sakamoto Maaya', '坂本真綾'], 'Maaya Sakamoto (坂本真綾)'),
            (['Mariya Takeuchi', 'Takeuchi Mariya', '竹内まりや'], 'Mariya Takeuchi (竹内まりや)'),
            (['Meiko Nakahara', 'Nakahara Meiko', '中原めいこ'], 'Meiko Nakahara (中原めいこ)'),
            (['Miliyah Kato', 'Kato Miliyah', '加藤ミリヤ'], 'Miliyah Kato (加藤ミリヤ)'),
            (['Mika Nakashima', 'Nakashima Mika', '中島美嘉', '大崎ナナ starring 中島美嘉'], 'Mika Nakashima (中島美嘉)'),
            (['Minako Yoshida', 'Yoshida Minako', '吉田美奈子', '吉田美奈子 & 渡辺香津美'], 'Minako Yoshida (吉田美奈子)'),
            (['Nami Tamaki', 'Tamaki Nami', '玉置成実'], 'Nami Tamaki (玉置成実)'),
            (['Namie Amuro', 'Amuro Namie', '安室奈美恵'], 'Namie Amuro (安室奈美恵)'),
            (['Nana Mizuki', 'Mizuki Nana', '水樹奈々'], 'Nana Mizuki (水樹奈々)'),
            (['Nanase Aikawa', 'Aikawa Nanase', '相川七瀬'], 'Nanase Aikawa (相川七瀬)'),
            (['Pizzicato Five', 'Takanami, Keitaro Combo & Orchestra AKA Pizzicato Five'], 'Pizzicato Five'),
            (['PoohPuella', '푸푸엘라'], 'PoohPuella (푸푸엘라)'),
            (['Rainie Yang', 'Yang Rainie', '楊丞琳'], 'Rainie Yang (楊丞琳)'),
            (['Ringo Sheena', 'Sheena Ringo', '椎名林檎'], 'Ringo Sheena (椎名林檎)'),
            (['Rocket Punch', '로켓펀치'], 'Rocket Punch (로켓펀치)'),
            (['Seika Iwashita', 'Iwashita Seika', '岩下清香'], 'Seika Iwashita (岩下清香)'),
            (['Shikao Suga', 'Suga Shikao', 'スガシカオ'], 'Shikao Suga'),
            (['Shinichi Osawa', 'Osawa Shinichi', '大沢伸一'], 'Shinichi Osawa (大沢伸一)'),
            (['Southern All Stars', 'Southern All Stars', 'サザンオールスターズ'], 'Southern All Stars'),
            (['Sphere', 'スフィア'], 'Sphere'),
            (['T-ARA', '티아라'], 'T-ARA (티아라)'),
            (['Tommy february6', 'Tommy February6'], 'Tommy february⁶'),
            (['Utada Hikaru', 'Hikaru Utada', '宇多田ヒカル', 'Utada Hikaru = Utada Hikaru'], 'Utada Hikaru (宇多田ヒカル)'),
            (['Wonder Girls', '원더걸스'], 'Wonder Girls (원더걸스)'),
            (['Yoshiko Goshima', 'Goshima Yoshiko', '五島良子'], 'Yoshiko Goshima (五島良子)'),
            (['Yuna Ito', 'Ito Yuna', '伊藤由奈', 'REIRA starring 伊藤由奈'], 'Yuna Ito (伊藤由奈)'),
            (['Yui Horie', 'Horie Yui', '堀江由衣'], 'Yui Horie (堀江由衣)'),
            (['Yui Sakakibara', 'Sakakibara Yui', '榊原ゆい'], 'Yui Sakakibara (榊原ゆい)'),
            (['Yukika', 'YUKIKA', '유키카'], 'Yukika (유키카)'),
            (['Yumi Matsutoya', 'Matsutoya Yumi', '松任谷由実'], 'Yumi Matsutoya (松任谷由実)'),
            (['Yuko Hara', 'Hara Yuko', '原由子'], 'Yuko Hara (原由子)'),
            (['Yuna Ito', 'Ito Yuna', '伊藤由奈'], 'Yuna Ito (伊藤由奈)'),
            
            # --- WESTERN / SPECIFIC REDIRECTS ---
            (['Air', 'AIR'], 'AIR'),
            (['Aqua', 'Emily Cardwell and Aqua', 'Nicki Minaj & Ice Spice', 'Rune Rask , Aqua , Suspekt'], 'Aqua'),
            (['Ant Saunders & Goldroom', 'DJ Orion & J.Shore & Goldroom'], 'Goldroom'),
            (['B-52\'s, The', 'The B-52\'s', 'The B-52s'], 'B-52s, The'),
            (['Big Brother & the Holding Company featuring Janis Joplin'], 'Big Brother & the Holding Company'),
            (['Captain Beefheart', 'Captain Beefheart & The Magic Band'], 'Captain Beefheart & His Magic Band'),
            (['Cream'], 'Cream'),
            (['DJ Ten & By an Ion', 'DJ Ten & Immortal Girlfriend', 'DJ Ten & Jessie Frye'], 'DJ Ten'),
            (['Grateful Dead', 'The Grateful Dead'], 'Grateful Dead'),
            (['Gary Numan', 'Radio Heart'], 'Gary Numan'),
            (['Jazz At Lincoln Center', 'Jazz at Lincoln Center Orchestra', 'Lincoln Center Jazz Orchestra'], 'Wynton Marsalis'),
            (['JAY-Z', 'JAY‐Z', 'JAY-Z & Ye', 'JAY-Z & R. Kelly', 'JAY‐Z & Ye', 'JAY‐Z & R. Kelly'], 'JAY-Z'),
            (['Jimi Hendrix, The', 'Jimi Hendrix Experience', 'The Jimi Hendrix Experience'], 'Jimi Hendrix'),
            (['Little Richard', 'Little Richard & Jimi Hendrix'], 'Little Richard'),
            (['M83', 'Jean‐Michel Jarre & M83'], 'M83'),
            (['Ian Anderson & Jethro Tull'], 'Jethro Tull'),
            (['MillionYoung', 'MILLIONYOUNG'], 'MILLIONYOUNG'),
            (['Phil Collins Big Band'], 'Phil Collins'),
            (['Paul Butterfield', 'Paul Butterfield Blues Band', "Paul Butterfield's Better Days", "Paul Butterfield’s Better Days", 'Paul Butterfield Blues Band, The'], 'Paul Butterfield Blues Band, The'),
            (['Ornette Coleman Trio', 'Ornette Coleman Quartet'], 'Ornette Coleman'),
            (['Queen + Paul Rodgers'], 'Queen'),
            (['Sly & the Family Stone'], 'Sly & The Family Stone'),
            (['George Shearing & Marian McPartland'], 'Marian McPartland'),
            (['Marc Bolan & T. Rex'], 'T. Rex'),
            (['Faron Young, Webb Pierce, Jerry Lee Lewis & Mel Tillis', 'Carl Perkins, Jerry Lee Lewis, Roy Orbison & Johnny Cash'], 'Jerry Lee Lewis'),
            (['Jem and the Holograms', 'Jem & the Holograms'], 'Jem & the Holograms'),
            (['Eraldo Bernocchi & Harold Budd'], 'Harold Budd'),
            (['Futurecop! & Parallels'], 'Futurecop!'),
            (['Anne Sofie von Otter & Elvis Costello'], 'Elvis Costello'),
            (['Emmylou Harris, Linda Ronstadt, Dolly Parton'], 'Dolly Parton'),
            (['Jonathan Tyler & The Northern Lights'], 'Northern Lights, The'),
            (['Linda Clifford & Curtis Mayfield'], 'Linda Clifford'),
            (['Wailers, The', 'Wailers', 'Bob Marley'], 'Bob Marley & The Wailers'),
            (['Bob Seger, The', 'Bob Seger System'], 'Bob Seger'),
            (['Alan Parsons, The', 'Alan Parsons Project'], 'Alan Parsons'),
            (['James Last / Astrud Gilberto', '向井滋春 + Astrud Gilberto'], 'Astrud Gilberto'),
            (['All The Damn Vampires & Yota'], 'All the Damn Vampires'),
            (['Sophy Con Tito Puente', 'Woody Herman & Tito Puente', 'Celia Cruz & Tito Puente'], 'Tito Puente'),
            (['Wu‐Tang Clan'], 'Wu-Tang Clan'),
            (['Tommy \'86', 'Tommy ’86'], 'Tommy ’86'),
            (['ALEX', 'ALEX & Megan McDuffee', 'ALEX & TOKYO ROSE as THE AKUMA', 'ALEX + TOKYO ROSE', 'TOKYO ROSE', 'Tokyo Rose', 'TOKYO ROSE & ALEX', 'TOKYO ROSE & Social Kid', 'TOKYO ROSE & Becko', 'TOKYO ROSE & Owl Vision', 'TOKYO ROSE & ZABO'], 'ALEX & Tokyo Rose'),
        ]

        artist_mapping = {}
        artist_mapping_ci = {}
        for group, target in alias_groups:
            for alias in group:
                artist_mapping[alias] = target
                if alias.lower() not in artist_mapping_ci:
                    artist_mapping_ci[alias.lower()] = target

        # PASS 1: Check Exact Match, then case-insensitive fallback
        if name in artist_mapping:
            return artist_mapping[name]
        if name.lower() in artist_mapping_ci:
            return artist_mapping_ci[name.lower()]

        # --- 4. SPECIAL STRING OVERRIDES (Contains Check) ---
        if 'tomasi' in name.lower() and 'wynton marsalis' in name.lower():
            return 'Wynton Marsalis'

        # --- 5. CLEANUP PROCESSING ---
        # Strip 'feat', 'with', 'vs', AND '×'
        name = re.split(r'\s+(?:featuring|feat\.?|ft\.?|with|vs\.?)\s+|\s*×\s*', name, flags=re.IGNORECASE)[0]
        name = name.strip()

        # PASS 2: Check Match AGAIN (exact, then case-insensitive)
        if name in artist_mapping:
            return artist_mapping[name]
        if name.lower() in artist_mapping_ci:
            return artist_mapping_ci[name.lower()]

        # --- 6. WESTERN TRUNCATION (Starts With Check) ---
        western_truncations = [
            '2Pac', '3OH!3', 'Aaliyah', 'Above & Beyond', 'Ace of Base', 'Achillea', 'Afrika Bambaataa', 'Air', 'Al Green', 
            'Alan Parsons', 'Alanis Morissette', 'Albert King', 'All the Damn Vampires', 'Aqua', 'Aretha Franklin', 'Ariana Grande', 'Astrud Gilberto', 
            'At 1980', 'B.B. King', 'Barenaked Ladies', 'Barry White', 'Beatbox Machinery', 'Big Brother', 'Billy Bragg', 
            'Billy Idol', 'Björk', 'Blood, Sweat & Tears', 'Bo Diddley', 'Bob Dylan', 'Bob Marley', 'Bob Seger', 
            'Bobby “Blue” Bland', 'Brant Bjork', 'Brian Eno', 'Bruce Springsteen', 'Captain Beefheart', 'Carole King', 
            'Carpenter Brut', 'Carpenters', 'Cher', 'Chicago', 'Christina Aguilera', 'Chuck Berry', 'Chumbawamba', 'Coldplay', 
            'Conway Twitty', 'Curtis Mayfield', 'D’Angelo', 'Dana Jean Phoenix', 'Dance With the Dead', 'David Bowie', 'David Byrne', 'DEADLIFE', 
            'Deep Purple', 'Diana Ross', 'Diane Schuur', 'Dion', 'DJ Jazzy Jeff', 'Dolly Parton', 'Don McLean', 'Downtown Binary', 
            'Dr. Dre', 'Dr. John', 'Droid Bishop', 'Dubmood', 'Ellie Goulding', 'Elton John', 'Elvis Costello', 'Eminem', 
            'Enigma', 'Eric Clapton', 'Eric Woolfson', 'Etta James', 'Flock of Seagulls', 'FM-84', 'Forhill', 'Fragma', 
            'Frank Sinatra', 'Frank Zappa', 'Futurecop!', 'Gary Burton', 'Gary Numan', 'Gary Wright', 'George Clinton', 
            'George Harrison', 'George Jones', 'George Michael', 'Gloria Estefan', 'Goldroom', 'Graham Parker', 'Gram Parsons', 
            'Grateful Dead', 'GUNSHIP', 'Hank Williams', 'Harold Budd', 'Helynt', 'Howlin’ Wolf', 'J.J. Cale', 'Jack Johnson', 
            'Jackie Wilson', 'Jackson Browne', 'James Brown', 'James Last', 'Janis Joplin', 'JAY-Z', 'Jem', 'Jerry Lee Lewis', 
            'Jessie Frye', 'Jethro Tull', 'Jimi Hendrix', 'John Foxx', 'John Lee Hooker', 'John Lennon', 'John Mayall', 'John Parish', 
            'John Prine', 'Johnny Cash', 'Joni Mitchell', 'Joy Division', 'Kansas', 'Kathleen Battle', 'Kenny Rogers', 'Kimmie Rhodes', 
            'King Creosote', 'La Bouche', 'Lady Gaga', 'Lights', 'Linda Ronstadt', 'Lindsey Buckingham', 'Lionel Richie', 
            'Loretta Lynn', 'Lou Reed', 'Luciano Pavarotti', 'Lucinda Williams', 'Lynyrd Skynyrd', 'M83', 'Madonna', 
            'Makeup and Vanity Set', 'Mariah Carey', 'Marian McPartland', 'Marvin Gaye', 'Meat Loaf', 'Merle Haggard', 
            'Metallica', 'Mike Posner', 'MillionYoung', 'Milt Jackson', 'Moby', 'Muddy Waters', 'Nas', 'Neil Young', 
            'NightStop', 'Nirvana', 'Notorious B.I.G.', 'Ornette Coleman', 'Otis Redding', 'Ozzy Osbourne', 'Pat Benatar', 
            'Pat Metheny', 'Patsy Cline', 'Patti LaBelle', 'Patti Smith', 'Paul Butterfield', 'Paul McCartney', 'Paul Simon', 
            'Petra Haden', 'Phil Collins', 'Pink Floyd', 'Prince', 'Public Enemy', 'R. Kelly', 'Ray Charles', 
            'Real McCoy', 'REO Speedwagon', 'Richard Marx', 'Rod Stewart', 'Roxette', 'Run-DMC', 'Ryan Adams', 'Salt-N-Pepa', 
            'Sam Cooke', 'Sandor Gavin', 'Scandroid', 'Scary Pockets', 'Sia', 'Simon & Garfunkel', 'Soft Cell', 'Sonic Youth', 
            'Sonny Boy Williamson', 'Southern All Stars', 'Stan Getz', 'Steve Cropper', 'Steve Earle', 'Stevie Ray Vaughan', 
            'Sting', 'Straplocked', 'Styx', 'Sugar Ray', 'Supremes', 'Televisor', 'Tito Puente', 'Todd Rundgren', 
            'Tom Petty', 'Tom Waits', 'Tommy ’86', 'Tony Bennett', 'Van Morrison', 'Velvet Underground', 'Vincenzo Salvia', 
            'Vitamin String Quartet', 'War', 'Waylon Jennings', 'Whitney Houston', 'Willie Nelson', 'Wu-Tang Clan', 
            'Wynton Marsalis', 'Yardbirds', 'Yoko Ono', 'Zombies'
        ]

        for artist in western_truncations:
            pattern = r'^' + re.escape(artist) + r'\b'
            if re.search(pattern, name, flags=re.IGNORECASE):
                name = artist
                break

        # --- 7. FINAL CLEANUP ---
        if 'weird al' in name_lower and 'yankovic' in name_lower:
            return u'“Weird Al” Yankovic'

        # Append suffix (The / A) if it existed
        return name + suffix

albumtypes:
    types:
        - ep: 'EP'
        - single: 'Single'
        - soundtrack: 'Soundtrack'
        - live: 'Live'
        - compilation: 'Anthology'
        - remix: 'Remix'
        - bootleg: 'Bootleg'
        - musical: 'musical'
    ignore_va: compilation
    bracket: '[]'

# ----------------------------------------------------------------------------
# Path Configuration
# ----------------------------------------------------------------------------
replace:
    '\/\\': '^'
    '∕\\': '^'
    '^\.': _            # If text starts with ., replace with underscore
    '[\x00-\x1f]': _    # Remove ASCII control characters (0 to 31 on ascii table)
    '[<>"\?\|]': ''     # Removes the Windows “reserved characters”
    # '\.$': _          # COMMENTED OUT: We want to KEEP trailing dots for "01."
    '\s+$': ''          # If text ends with a space, remove space
    '^\s+': ''          # If text starts with a space, remove space
    '^-': _             # If text starts with -, replace with underscore
    '[\.]{3}$': …       # Replace 3 dots at end of text with special ellipis character
    '[:]': ∶            # Replace colon with a smaller one
    '[*]': ∗            # Replace asterisk with a smaller one
    '\.$': ''         # COMMENTED OUT: We want to KEEP trailing dots for "01."
    #'[\u2215\u2044]': _   # Replace division slash ∕ or fraction slash ⁄ with underscore
    #'[\\/]+': _           # Replace normal slashes and backslash

path_sep_replace: ∕

aunique:
    keys: album mb_releasegroupid year
    disambiguators: albumdisambig label catalognum tracktotal
    bracket: '[]'

paths:
    # --- Priority 1: High Priority Types (Labels, Soundtracks, Musicals) ---
    label::(Anjunabeats|A.State.[Oo]f.Trance|Anjunadeep): "[Labels]/$label/[$catalognum] $albumartist - $album%aunique{}/$disc_and_track $title"
    
    # Moved Soundtracks to top priority and used plural 'albumtypes' to catch list members
    albumtypes:soundtrack: "[Soundtracks]/$album%aunique{} ($year) [$albumartist]/$disc_and_track $title"
    albumtypes:musical:    "[Musicals]/$album%aunique{} ($year) [$albumartist]/$disc_and_track $title"
    
    # --- Priority 2: Now That's What I Call Music ---
    album:"what i call music" album:"millennium series": "[Compilations]/Now That's What I Call Music/The Millennium Series/[$year] $album%aunique{}/$disc_and_track $title"
    album:"what i call music" country:US: "[Compilations]/Now That's What I Call Music (US)/[$year] $album%aunique{}/$disc_and_track $title"
    album:"what i call music" country::"(GB|IE|UK|Europe|XE)": "[Compilations]/Now That's What I Call Music (UK)/[$year] $album%aunique{}/$disc_and_track $title"
    album:"what i call music": "[Compilations]/Now That's What I Call Music/Unknown Region/[$year] $album%aunique{}/$disc_and_track $title"

    # --- Priority 3: Specific Compilations (Using Dot . instead of spaces/regex for safety) ---
    album::Dream.Dance: "[Compilations]/Dream Dance/[$year] $album%aunique{}/$disc_and_track $title"
    album::Maxi.Dance.Sensation: "[Compilations]/Maxi Dance Sensation/[$year] $album%aunique{}/$disc_and_track $title"
    album::Chillhop.Essentials albumtype:compilation: "[Compilations]/Chillhop Essentials/[$year] $album%aunique{}/$disc_and_track $title"
    album::Trance.Voices albumtype:compilation: "[Compilations]/Trance Voices/[$year] $album%aunique{}/$disc_and_track $artist - $title"
    album::Tunnel.Trance.Force albumtype:compilation: "[Compilations]/Tunnel Trance Force/[$year] $album%aunique{}/$disc_and_track $artist - $title"
    album::This.Is… albumtype:compilation: "[Compilations]/This Is… Series/$album%aunique{}/$disc_and_track $title"

    # --- Priority 4: Standard Types (Using $folderartist) ---
    albumtype:ep:          "[Artists]/%bucket{$folderartist}/$folderartist/EPs/[$year] $album%aunique{}/$disc_and_track $title"
    albumtype:single:      "[Artists]/%bucket{$folderartist}/$folderartist/Singles/[$year] $album%aunique{}/$disc_and_track $title"
    albumtypes:live:        "[Artists]/%bucket{$folderartist}/$folderartist/Live/[$year] $album%aunique{}/$disc_and_track $title"
    albumtype:remix:       "[Artists]/%bucket{$folderartist}/$folderartist/Remixes/[$year] $album%aunique{}/$disc_and_track $title"
    albumtype:bootleg:     "[Artists]/%bucket{$folderartist}/$folderartist/Bootlegs/[$year] $album%aunique{}/$disc_and_track $title"
    
    # --- Priority 5: Compilation Logic ---
    albumtypes:compilation: "%if{$is_various,[Compilations]/$album%aunique{}/$disc_and_track $artist - $title,[Artists]/%bucket{$folderartist}/$folderartist/Anthologies/[$year] $album%aunique{}/$disc_and_track $title}"
    
    # --- Catch-all ---
    singleton: Non-Album/$folderartist - $title
    default:   "[Artists]/%bucket{$folderartist}/$folderartist/Albums/[$year] $album%aunique{}/$disc_and_track $title"

# ----------------------------------------------------------------------------
# Plugin Configuration
# ----------------------------------------------------------------------------
bucket:
    bucket_alpha: ['#-!', '0-9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
    bucket_alpha_regex:
        '#-!': ^[^0-9a-zA-Z]
    extrapolate: no

filetote:
    extensions: .*
    filename: "folder.jpg Folder.jpg cover.jpg Cover.jpg"
    paths:
        pattern:logfolder:    "$albumpath/Log/$old_filename"
        pattern:cuefolder:    "$albumpath/Cue/$old_filename"
        pattern:scansfolder:  "$albumpath/Scans/$old_filename"
        ext:7z:      "$albumpath/Data/$old_filename"
        ext:log:     "$albumpath/Data/$old_filename"
        ext:cue:     "$albumpath/Data/$old_filename"
        ext:zip:     "$albumpath/Data/$old_filename"
        ext:txt:     "$albumpath/Data/$old_filename"
        ext:nfo:     "$albumpath/Data/$old_filename"
        ext:m3u:     "$albumpath/Data/$old_filename"
        ext:jpg:     "$albumpath/Scans/$old_filename"
        ext:png:     "$albumpath/Scans/$old_filename"
        ext:pdf:     "$albumpath/Scans/$old_filename"
        filename:folder.jpg: "$albumpath/folder"
        filename:cover.jpg:  "$albumpath/folder"

lastgenre:
    auto: yes
    canonical: yes
    count: 5
    source: album
    whitelist: yes

scrub:
    auto: no

hooks:
    album_imported:
        command: echo "Imported to $library_path"

web:
    host: 0.0.0.0
    port: 8337