I’ll try to clarify my original intention to start. I have a music library where I like it to be stored in a particular layout, which makes sense to me from a sort of otological perspective, but which nonetheless isn’t really convenient to navigate when I actually want to listen to the music.
For example, I like a simple layout of artist and album for storage for posterity, but in reality I don’t find it nice to navigate when you have a ton of single tracks from a ton of albums, that’s a lot of depth to navigate for single tracks. I also like to store my library organized by where I acquired the music. Amazon, iTunes, etc, as it eases re-downloading of any music which is missing or corrupt, but of course that’s not something I care about when I want to listen to it.
I also use a media player device which supports high resolution lossless audio, which has a small lcd, so there are quirks to that, for example, I like to shorten longer album, media, and artist names to ease navigation on such a small display, but I’d never want to do that to the long term library storage.
So, I heavily utilize the beets-alternatives
plugin in symlink mode to set up the alternate view(s) into the library. Something like rewrite
would be much more convenient than using template functions everywhere in the alternative path formats, but I can’t use rewrite
itself, as that also changes the default path formats.
Here’s an incomplete subsection of my config prior to my conversion over into using a plugin instead of path formats. You’ll note heavy use of my plugins to attempt to make the queries and formats more maintainable. In the end, shifting it all into a plugin is probably best anyway, so I’m not sure this line of inquiry needs to go anywhere. But I hope you see the intention — I wanted to change how fields like ‘artist’ were used, but only in the alternatives path formats, not the default path formats. But, in the end, calling into a template function wasn’t that onerous, and the path format evaluation performance meant the plugin approach was best.
album_queries:
is_game: 'avmedia:"Video Games"'
is_incomplete_album: 'album_query:is_game missing:2.. , ^album_query:is_game missing:1..'
is_sampler: 'albumtypes:sampler , album:sampler'
# This is used both in an alias command and modifyonimport
is_various_not_comp: 'comp:0 albumartist:@"Various Artists"'
item_queries:
# Used by the sole-tracks script
is_mfp: 'label:"Music for Programming"'
is_ocremix: 'label:"OverClocked ReMix"'
sole_track_candidates: 'query:is_music \^query:is_mfp \^query:is_ocremix \^query:is_game'
# As-needed
albums_to_split_up: 'query:is_incomplete_album existing:..4'
is_incomplete_album: 'query:is_game missing:2.. , ^query:is_game missing:1..'
is_loved: album_loved:true , loved:true query:for_single_tracks
# General and Path Formats. A number of these are used by the `kergoth` plugin for $navigation_path.
for_single_tracks: 'singleton:true , single_track:true'
is_christmas: 'genre:Christmas'
is_classical: 'genre:Classical'
is_game: 'avmedia:"Video Games"'
is_music: '^query:is_non_music'
is_non_music: 'genre:speech , genre:meditation , genre:dharma , genre:book , genre:spoken , genre:background , albumtypes:spokenword , albumtypes:audiobook , albumtypes:"audio drama" , albumtypes:interview'
is_sampler: 'albumtypes:sampler , album:sampler'
is_sole_track: 'sole_track:true'
is_soundtrack: 'albumtypes:soundtrack , genre:soundtrack ^query:is_sampler'
# Categories
alt_game_extra: '^albumtypes:soundtrack query:is_game'
alt_game: 'query:is_game albumtypes:soundtrack , query:is_game ^mediatitle:^'
alt_to_listen: 'to_listen:true'
by_label_flat: 'label:"Music for Programming"'
chiptune_game: 'genre:chiptune query:is_game query:is_soundtrack'
chiptune: 'genre:chiptune'
christmas_sole_tracks: 'genre:Christmas query:is_sole_track'
christmas: 'query:is_christmas'
classical_sole_tracks: 'genre:classical query:is_sole_track'
classical: 'query:is_classical ^query:is_soundtrack'
non_music: 'genre:meditation , genre:background , albumtypes:spokenword , albumtypes:audiobook , albumtypes:"audio drama" , albumtypes:interview'
sampler: 'query:is_sampler ^query:for_single_tracks'
soundtrack: 'query:is_soundtrack ^query:for_single_tracks'
item_formats:
# Unasciified, credited artist
path_filename: '%if{$album,$disc_and_track_pre}%if{$comp,%if{$artist_credit,$artist_credit,$artist} - }$full_title'
# Path format components
artist_title: '%the{$path_artist} - $full_title'
path_artist: '%asciify{%replace{artist,$artist}}'
full_title: '$title%if{$e_advisory,$explicit_or_clean}'
comp_filename: '%if{$album,$disc_and_track_pre}%if{$comp,$path_artist - }$full_title'
albumsuffix: '%if{$e_albumadvisory, (Explicit)}'
albumname: '%if{$album,$album%aunique{}$albumsuffix,Single Tracks}'
albumartistname: '%if{$comp,Compilations,%if{$classical,%if{$album_composer,$album_composer,$albumartist},$albumartist}}'
artistname: '%if{$classical,%if{$composer,$composer,$artist},$artist}'
franchisename: '%replace{franchise,$franchise} Franchise'
gamename: '$game%ifdef{gamedisambig, [$gamedisambig]}%if{$album,$albumsuffix}'
# Directories
albumartistdir: '%the{%asciify{%replace{artist,$albumartistname}}}'
artistdir: '%the{%asciify{%replace{artist,$artistname}}}'
albumonlydir: '%replace{album,%ifdef{$game,$gamename,$albumname}}'
franchisedir: '%the{$franchisename}'
albumdir: '%the{%ifdef{franchise,%path{$franchisedir,$albumonlydir},$albumonlydir}}'
# Layouts
by_album: '%path{$albumdir,$comp_filename}'
bucket_by_album: '%if{$for_single_tracks,%path{Single Tracks,$artist_title},%path{%bucket{$albumdir,alpha},$by_album}}'
by_artist: '%if{$for_single_tracks,%path{$artistdir,Single Tracks,$full_title},%path{$albumartistdir,$by_album}}'
bucket_by_artist: '%path{%bucket{%if{$for_single_tracks,$artistdir,$albumartistdir},alpha},$by_artist}'
bucket_by_label_flat: '%path{%bucket{$label,alpha},$label,$artist_title}'
alternatives:
formatted:
directory: '../Alternatives/Formatted'
formats: link
query: ^disliked:true
paths:
query:loved_single_tracks: 'Loved/Single Tracks/%replace{dap,$artist_title}'
'genre:Chiptune album_loved:true': 'Loved/Chiptunes/%replace{dap,%if{$for_single_tracks,Single Tracks/$artist_title,$media_albumdir/$comp_filename}}'
'query:is_game album_loved:true': 'Loved/Games/%replace{dap,%if{$for_single_tracks,Single Tracks/$artist_title,$media_albumdir/$comp_filename}}'
'album_loved:true query:soundtrack': 'Loved/Soundtracks/%replace{dap,$albumdir/$comp_filename}'
album_loved:true: 'Loved/Albums/%replace{dap,$albumdir/$comp_filename}'
to_listen:true: 'To Listen/%replace{dap,%if{$for_single_tracks,Single Tracks/$artist_title,$media_albumdir/$comp_filename}}'
query:is_non_music: 'NonMusic/%replace{dap,$genre/$albumartistdir/$albumdir/$comp_filename}'
query:is_mfp: 'Music/%bucket{$label,alpha}/%replace{dap,$label/$full_title}'
'query:is_sole_track query:classical': '%replace{dap,Classical/Single Tracks/$artist_title}'
query:classical: 'Classical/%replace{dap,%if{$for_single_tracks,$artistdir/Single Tracks/$full_title,$albumartistdir/$albumdir/$comp_filename}}'
'genre:chiptune query:alt_game': 'Chiptunes/Games/%replace{dap,%ifdef{franchise,%bucket{$franchisedir,alpha}/$franchisedir/,%bucket{$media_albumdir,alpha}/}$media_albumdir/$comp_filename}'
'genre:chiptune': 'Chiptunes/Music/%replace{dap,%if{$for_single_tracks,$artistdir/Single Tracks/$full_title,$albumartistdir/$albumdir/$comp_filename}}'
'query:alt_game ^franchise:^': 'Games/%replace{dap,%bucket{$franchisedir,alpha}/$franchisedir/%if{$for_single_tracks,Single Tracks/$artist_title,$media_albumdir/$comp_filename}}'
query:alt_game: 'Games/%replace{dap,%if{$for_single_tracks,Single Tracks/$artist_title,%bucket{$media_albumdir,alpha}/$media_albumdir/$comp_filename}}'
query:is_game: 'Games/Extras/%replace{dap,%ifdef{franchise,$franchisedir/}%if{$for_single_tracks,Single Tracks/$artist_title,$media_albumdir/$comp_filename}}'
'query:is_sole_track query:is_christmas': 'Christmas/%replace{dap,Single Tracks/$artist_title}'
query:is_christmas: 'Christmas/%replace{dap,%if{$for_single_tracks,$artistdir/Single Tracks/$full_title,$albumartistdir/$albumdir/$comp_filename}}'
query:is_sole_track: 'Music/Single Tracks/%replace{dap,$source/$artist_title}'
query:soundtrack: 'Soundtracks/%replace{dap,$albumdir/$comp_filename}'
query:sampler: 'Samplers/%replace{dap,$albumdir/$comp_filename}'
comp:1: '%replace{dap,%if{$for_single_tracks,Music/%bucket{$artistdir,alpha}/$artistdir/Single Tracks/$full_title,Music/Compilations/$albumdir/$comp_filename}}'
default: '%replace{dap,%if{$for_single_tracks,Music/%bucket{$artistdir,alpha}/$artistdir/Single Tracks/$full_title,Music/%bucket{$albumartistdir,alpha}/$albumartistdir/$albumdir/$comp_filename}}'