Music Banter

Music Banter (https://www.musicbanter.com/)
-   The Lounge (https://www.musicbanter.com/lounge/)
-   -   Foobar2000 - Support and Discussions (https://www.musicbanter.com/lounge/47287-foobar2000-support-discussions.html)

Guybrush 03-26-2010 01:24 AM

Quote:

Originally Posted by Zero1986 (Post 841517)
Cheers. Yeah it pretty much worked for me, only i used $swapprefix(%artist%,The) cos i don't really mind the 'A' prefixes. I can't seem to find a way to sort it like that but still display the artist as 'The Artist'. Facets gives you this option but Filter in columns UI doesn't. I know it's only a small thing but it still bugs me haha.

The solution is simple here. If you have a code for view format, just show %<artist>% or $meta(artist,0) or something there, not $swapprefix(%<artist>%).

Just use $swapprefix() code in the sorting code. :)

Here's an example from my library tree config. I've marked the %<artist>% code used to show my music in the field named "view format". Below, in the sort field, you can see $swapprefix(%album artist%).

http://xs.to/image-6A48_4BAC5E21.jpg

This makes "The Prodigy" appear just like I wrote it, but sorts it as if it was "Prodigy, The". If you don't have a separate view/sorting code in your setup, well .. You should!

%<artist>% outputs any artist in the artist field. If the song "Islands in the Stream" has multiple artists in the artists field, say "Dolly Parton; Kenny Rogers", the song will be listed under both.

$meta(artist,0) would only output the first value, Dolly Parton. You can use these features to tag music for example belonging to several genres at once. :)

noise 03-26-2010 02:13 AM

that works for Library Tree, and you can do something similar in most Playlist views, but unfortunately it is not possible in Filters, because there is no seperate sort code.

answer i got from the official forums:

Quote:

Filters always sorts by what it displays. As a workaround, you can insert the letter you want to sort by at the beginning and set it to have the same foreground and background color to hide it.

Guybrush 03-26-2010 06:11 AM

I might be misunderstanding what filters we're talking about, but at least the ColumnsUI filters have a sorting script option.

http://xs.to/image-8212_4BACA286.jpg

I've marked some code to show where you find the option in the picture. As you can see, artist just shows %artist%, but checking the option to sort incoming files should sort it as if by $swapprefix() :)

Note that I don't use these filters myself much, though!

noise 03-26-2010 08:41 AM

that sorts the files as they are added to the playlist from the filter panel, but it does not change the way they are displayed in the filer panel itself :)

Guybrush 03-26-2010 08:50 AM

Quote:

Originally Posted by noise (Post 841811)
that sorts the files as they are added to the playlist from the filter panel, but it does not change the way they are displayed in the filer panel itself :)

Isn't that just the thing? He wants artists displayed as they are, but wants them sorted as by $swapprefix() ..

Quote:

Originally Posted by zero
I can't seem to find a way to sort it like that but still display the artist as 'The Artist'.

My examples above do that, so unless I'm mistaken, it should be just the thing he's looking for? :confused:

Here's my own filters :

http://xs.to/image-AEEA_4BACC794.jpg

The Prodigy are sorted under P due to $swapprefix(), but still show up as "The Prodigy" in the filter.

noise 03-26-2010 10:19 AM

woah something is amiss

that Sort field has nothing to do with how the entry is displayed in a Filter. it only comes into effect when you click an item in the Filter - then it gets sorted on its way to the playlist.

yet the Filter in your screenshot is doing what the OP is asking for.

could you past the code for that artist filter here? i want to take a look at it :D

Guybrush 03-26-2010 10:30 AM

Quote:

Originally Posted by noise (Post 841841)
could you past the code for that artist filter here? i want to take a look at it :D

There is no code aside from the sort script really. If you look at the screenshot up there, the filter that shows artist only has "artist" in it :p:

I'll change it to %<artist>% now, though. That's what I'd like it to be. :)

edit :

My sorting script looks like this : $swapprefix(%artist%) $if(%release year%,%release year%,%date%) %album% $if(%disc number%,$left(%disc number%,2),) %tracknumber% %title%

%release year% is a tag I've made which is used when present instead of date. The reason is if I have a "best of the 80s" album released in 2009, I'd set the %release date% to 2009 and hope to tag each song with the original date which is sometime in the 80s. The reason I'm using the left 2 disc numbers is that I sometimes write disc numbers like this "2 - Bonus Disc" (or have in the past anyways), so that's to make sure I only fetch numbers.


more edit :

My Library Tree sorting script looks like this : $swapprefix(%album artist%) $if(%debut%,0,1) $if(%release year%,%release year%,%date%) %album% $if(%disc number%,$left(%disc number%,2),) %tracknumber% %title%

It's much the same except it makes doubly sure anything tagged as debut comes first. This is to sort out conflicts where an artist has a second release the same year as the debut.


edit yet again :

Ugh, I see filters won't accept "%<artist>%" .. That's losing a really neat functionality there!

noise 03-26-2010 10:47 AM

there's something seriously mysterious going on here.

i cannot reproduce the sorting displayed in your screenshot no matter what i do. changing the sort only changes how the files are added to the playlist.

officially, what you have displayed there is not possible using Filters.

Guybrush 03-26-2010 10:55 AM

Ohh right, I think I might know what's going on ..

If you check my settings, I've checked off for "By field list above". What that does is it makes artist first sort by the filters above it in the list. Checking this off creates a mess where "The Prodigy" gets back under the letter T. Just remember to move your filters up and down in the list so that they're right in the right position, something similar to what I've done in the screenshot.

I'm proud I've stumbled over something I take it people must've struggled with for a while though. :p:

The code for artist and genre is just artist and genre respectively, but the other two are :
  • Artist Index : $left($swapprefix($replace(%album artist%,:,!,.,!,0,#,1,#,2,#,3,#,4,#,5,#,6,#,7,#,8, #,9,#)),1)
  • Album : $if(%release year%,%release year%,$left(%date%,4)) - %album%

The artist index code lists the first letter unless it's a number. Then it gets sorted under #. Punctuations go under ! although I add those to the code as they appear in my library so there aren't too many specified cases there.

noise 03-26-2010 11:58 AM

bingo!

if you choose P, you get The Prodigy, but alphabetically, it's still filed under 'T'

so it's not really a solution after all :(

EDIT

"By field list above" refers to the physical position of a Filter in your config. it only changes how things are displayed if you have multiple filters...


All times are GMT -6. The time now is 01:54 AM.


© 2003-2025 Advameg, Inc.