Can I get Album List to ignore the prefixed "The" when sorting by folder structure?

Support :snoo_biblethump:

There seem to be no ways to edit the "by folder structure" view at all, at least not in the Album List preferences pane.

I could just rename the folders (e.g. "Cure, The" instead of "The Cure") but I don't like that at all, so I'm curious if there's another way to sort them alphabetically without removing "The" entirely.

Posted Apr 2, 2023, 12:11 PM UTC · edited

911
ghstchldrn•

Hi there,

No way to change default Album List folder view... You could make a custom view that replicates folder structure, however best result of sorting / display would be "Cure, The" ($swapprefix) without renaming folders.

Maybe instead you could use Library Tree with $nodisplay function to sort the artist folder ignoring prefix (display "The Cure"), with a custom view that replicates folder structure. Coming up with the title formatting though gets complicated, depends on what the folder structure looks like exactly, how consistent, how many different folders being monitored, etc, etc...

Comments of this topic gives some options to show each folder level. However remember those patterns are for column library views, while tree structure needs the complete folder pattern (each folder level separated by | character)

(I'm not on PC to test right now, maybe later...)

2
FireWire400OP•

I'll have to play around a little. Thanks a bunch!

Edit: Looks like %path_sort% ignores the prefix entirely but leaves it in place. How would I go about recreating the folder structure view?

I'm currently displaying the artists with $directory(%path_sort%, 2), but beyond that no idea.

1
ghstchldrn•

Edit: Looks like %path_sort% ignores the prefix entirely

This is not what I'm seeing - %path_sort% still displays all artists beginning with "The" under the letter T.

Are you still using Album List or did you install Library Tree (w/ Spider Monkey Panel)?

How would I go about recreating the folder structure view?

This is difficult to answer without knowing your folder structure. I mean, if ALL your artist folders are displaying correctly on level 2 (not mixed up with album folders?), then it could be as easy as this -

$directory(%path%,2)|$directory(%path%,1)|%filename_ext%

Then you would add $stripprefix() to remove "The" prefix from beginning of artist folders -

$stripprefix($directory(%path%,2))|$directory(%path%,1)|%filename_ext%

^ Try that in Album List. If you had a folder "The Beatles" it would be listed under "Beatles". (Or with $swapprefix it would be "Beatles, The")

Then moving on to Library Tree, you would add $nodisplay to the above, followed by the original folder you want displayed -

$nodisplay{$stripprefix($directory(%path%,2))}$directory(%path%,2)|$directory(%path%,1)|%filename_ext%

^ Now a folder called "The Beatles" would be listed under "The Beatles" with other artists under the letter B.

BUT this only works if ALL tracks are 2 folder levels deep. Therefore you might need to swap out the $directory(%path%,2) part to get the correct folder, with the examples listed in the already linked topic above. (I cannot really explain how it works any better than I already did there)

So if the above is mixing up folders, try the $directory examples posted by Freeky in that topic, in Library Tree -

$nodisplay{$stripprefix($directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),2)))}$directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),2))[|$directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),3))][|$directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),4))]|%filename_ext%

^ This should show up to 3 folder levels, with the first one ignoring the prefix. BUT this only works if ALL monitored folders are the same folder level. (In Preferences > Media Library)

(Edit: Fixed codes that reddit screwed up)

2
FireWire400OP•

This is not what I'm seeing - %path_sort% still displays all artists beginning with "The" under the letter T.

Never mind, I thought it worked but it seems that ReFacets does it automatically anyway(?)

This is difficult to answer without knowing your folder structure.

It's \Artists\Album\Tracks.wav, the code you've posted here is actually already spot-on. Is there a way to adapt this to ReFacets?

As for the rest, I'll have to look up how to install Libary Tree as I'm only used to the normal Album List. Thanks for the detailed response!

1
ghstchldrn•

Interesting. ReFacets does seem to ignore prefix by default, with no option to turn it off even. So it does not strictly follow the title formatting you enter in the columns (which is not good for mind...)

I'm not bothering too much with v2 for the time being...

1
ghstchldrn•

By the way, the usual quick way of replicating folder structure view in Album List is this -

$replace($directory_path($substr(%path%,10,999)),\,|)|%filename_ext%

This example begins at 10 characters in from the %path% -

D:\Music\Artist\Album\Track.MP3
         |
        10th character

So if your folder structure looks like that - artist folder on the second level, you could use that with the previously mentioned Library Tree code -

$nodisplay{$stripprefix($directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),2)))}$replace($directory_path($substr(%path%,10,999)),\,|)|%filename_ext%

(A little cleaner / faster than the last example I posted)

2
09212•

are you using Facets by any chance?

1
FireWire400OP•

Not that I know of...

1
B4TTL3P1G•

I know this doesn't exactly answer your question but want to put it out there since these quality of life changes are why I switched, but MusicBee does what you're looking for but can also be reconfigured. There are tradeoffs of course, but if I were you I'd look into whether another program like that might do what you want. It also allows for WASAPI exclusive output by default which was the other major function I cared about. I hope posting this here isn't an issue.

0
FireWire400OP•

AFAIK, Foobar switched to WASAPI as its default a few versions ago and as for MusicBee, I'll have a look at it but most likely won't switch as Foobar suits me just fine.

2
B4TTL3P1G•

Oh, cool, I hadn't realized they Foobar switched that good! I totally understand not wanting to switch, it was initially a bit of a pain to get everything carried over.

1