Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: custom sort string, keep VAs together (Read 4585 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

custom sort string, keep VAs together

So I had a weird thing happen.  I opened foobar the other day and everything was gone for no reason that I can discern.  I lost my ColumnsUI config info, my custom sort strings, my panels config, playlist gen strings, etc.

I've managed to get most of it back.  I don't have a sort string currently that keeps Various Artists together; the one I used to use I found on here, but I searched and can't find it now. 

Most of my albums by VA are in a VA directory, but some are simply in a folder with the album name.  I'm not sure if that makes a difference, but I thought I'd mention it.  I just use the Playlist > Sort by... command.

The rest of it is sorted by Artist, album, track #, possibly title?  I don't think the old sort method discriminated by date, just album is fine.

Can anyone help?  My ability to manipulate tagz is much crappier than I'd like; it just gets complicated so fast and makes my head want to explode.

custom sort string, keep VAs together

Reply #1
Do you tag your VA albums with %album artist%? Here's my sort string maybe it will work for you:
Code: [Select]
%album artist%|$if(%tracknumber%,%date%,0)|$if(%tracknumber%,%cdid%,)|$if(%tracknumber%,%album%, )|%discnumber%|%tracknumber%|%path_sort%|%genre%

custom sort string, keep VAs together

Reply #2
Wow, that was fast.  Thank you!

Yes, I do tag my VA albums with %album artist%.  Your string kept them together, but the track order goes 1, 10, 11... instead of 1, 2, 3...

I believe most of the tracknumbers are single digits until 10; I didn't know you could pad them until much later.  So most of them are 1, 2, 3, 10, but some of them are 01, 02, 03.  The ones with 01, etc are obviously okay.

custom sort string, keep VAs together

Reply #3
see the part toward the right that says "|%tracknumber|" ?
change it to "|$num(%tracknumber%,2)|"

Or if you ever anticipate having an album with more than 99 tracks, change the 2 to a higher number

custom sort string, keep VAs together

Reply #4
Thanks.  That worked.

Is that for a playlist of ONLY various artists cds?  What does that string mean, in english?

I ask because all the rest of my albums that are not VA are in no apparent order.  For example, in one portion of my playlist it goes from Coo Coo Cal to The Prodigy.  They are all in correct track order, however.

Is there a way to sort my entire playlist alphabetically by artist, then by album, and also keep all the VA stuff together?

custom sort string, keep VAs together

Reply #5
The trick to keeping VA artists together is to properly tag them with %album artist%. Foobar automatically fills in any missing %album artist% with %artist%.  So if you then sort by %album artist% it's basically the same as sortign by %artist% but it keeps the VA albums together.

So to answer your question use a simple sort of:
%album artist%|%album%

Though I would strongly suggest putting a %discnumber% after the %album% if you use the tag.. so discs appear in order with multidisc sets.


Translation of my sort string:
- Sort by album artist (see above)
- If a track number exists, it's probably an album. Sort by year. The 0 groups single loose tracks above the albums.
- If a track number exists, it's probably an album. Sort by %cdid% if it exists. (CDID is a universal cd catalog system used in asia and parts of europe)
- If a track number exists, it's probably an album. Sort by %album% name.
- Sort by disc number
- Sort by track number
- Sort by directory structure, this is useful for when I throw a bunch of random stuff off my HD into a playlist
- Sort by genre, I use this for sorting my online radio playlist actually I dont use the %genre% anymore from here I should trim this off :)

custom sort string, keep VAs together

Reply #6
This is my main sort string:
Code: [Select]
$if($strcmp($left(%album artist%,4),The ),$right(%album artist%,$sub($len(%album artist%),4))', 'The,%album artist%) - %album% - %codec% - $num(%tracknumber%,2)

This sorts by Artist, or Album Artist if available, ignoring the "The " in Artist names.  It then sorts by Album, then by Codec, followed by Tracknumber.

custom sort string, keep VAs together

Reply #7
I guess I don't know how to wrap my head around this.  Using this code gets me the closest, I think:

Code: [Select]
%album artist% - %artist% - %album% - $num(%tracknumber%,2)


This string manages to start alphabetically by artist and keeps all the albums by each artist together.  So far as I can tell, it manages to put singles in their right place as well; two Ashanti singles follow my Aqualung album, for example.

It chokes when it gets to VAs, however.  It correctly identifies the "artist" as VA, but then sorts by the actual artist.  In other words, if two seperate VA albums both have tracks by artists beginning with A, it will sort them alphabetically.

Lastly, I have a series of tracks I got from OC remix.  I couldn't think of a better way to tag them, so they are all tagged thusly:  artist is "oc remix" and the title is "game - title".  This string lumped all OC remix tracks together, but sorts them nilly willy.  The titles go from Mega Man to Kingdom Heats to Final Fantasy.  Is there a way to keep these together too?

Man, I wish I could find that old string that I copied from a post here.  Thanks guys; I really do appreciate it.

custom sort string, keep VAs together

Reply #8
I guess I don't know how to wrap my head around this.  Using this code gets me the closest, I think:

Code: [Select]
%album artist% - %artist% - %album% - $num(%tracknumber%,2)


It chokes when it gets to VAs, however.  It correctly identifies the "artist" as VA, but then sorts by the actual artist.  In other words, if two seperate VA albums both have tracks by artists beginning with A, it will sort them alphabetically.


Take %artist% out of the string; that's what's messing up the order. %album artist% replaces %artist%.

custom sort string, keep VAs together

Reply #9
Quote
Take %artist% out of the string; that's what's messing up the order. %album artist% replaces %artist%.
I should have mentioned that I tried that.  It does really wonky things.  My playlist begins with Oasis, switches to a bunch of singles in random order, then gets to (mostly) full albums.  Even then, they are not in the right order.

I can't figure it out

edit:  for the record, my stuff is tagged correctly, so I know that's not an issue.  Nearly all my singles are simply artist and title; a few have albums, even less have tracknumbers.  And they are all in a =singles= directory.  All of my VA uses %album artist% and without exception, all of my albums are tagged correctly with artist, title, album, date, and tracknumbers.

custom sort string, keep VAs together

Reply #10
Using your tags, is there any way for foobar to know if any given track is part of an album?

Many of us use %tracknumber%, but that means 1) you need to delete tracknumber tags from all your singles and 2) you need to make sure all your albums have track number tags.

I think the problem besides the aforementioned %album artist% vs. %artist%, is that when you sort by %album% foobar is mixing singles that have album tags with albums that have album tags.

If you choose to use %tracknumber% to separate your albums you can use a sort string like this:

%album artist%|$if(%tracknumber%,%album%, )|$num(%tracknumber%,2)

custom sort string, keep VAs together

Reply #11
Okay, I see.  I'll look through my stuff and try that and report back.

custom sort string, keep VAs together

Reply #12
Okay.  Like 95% of my singles had no tracknumbers, so I tried your string Yotsuya.

Seemingly random results, again.  It begins with a bunch of singles, then moves to random albums--Maroon 5 is the first listed.  Interspersed between these random albums are random singles.

I think this is one way to say how I'd like it to be:

1.  sort alphabetically by artist
1a. within each artist, sort alphabetically by album
1b. singles should also appear in this alphabetical list. so if I had a maroon 5 single, it would appear before a Michelle Branch album
2. VA albums are grouped together (ie. they appear under V alphabetically)

custom sort string, keep VAs together

Reply #13
%album artist%|$if(%tracknumber%,%album%,%title%)|$num(%tracknumber%,2)

Should give you that but the only thing different than the previous string is where to put the singles. In fact I just tested the string on my own foobar and it resulted in the proper sorting.

Are you sure your files are properly tagged? Find a track that appears out of order and look at the tags. Are you sure you have the artist under %artist% and title under %title% and not "artist - title" under %title% or anything like that?

 

custom sort string, keep VAs together

Reply #14
I was wondering how I would be able to sort without "the" or "a" in front of it. How would I append ", the" and ", a" depending?