Skip to main content
Topic: Song title sorting (Read 242 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Song title sorting

Is there a way to tell fb2k (or Facets etc) to ignore the first character of a title when it's not a letter or a number, but only in respect to alphabetical sorting. I'm wanting to duplicate the Facets "ignore the leading The" option, but for other characters.

What I'm hoping to achieve is this:
I have a song called "(Baby) Coming home". As the first character is an opening bracket, it's not sorted "alphabetically" as such, but it's found between the titles beginning with a number and titles beginning with "A"..
Worst case scenario, I'd like it sorted so it's found after titles beginning with "A". Ideally, it'd be found with the other titles beginning with "Ba" etc.

Thanks.

Re: Song title sorting

Reply #1
Hi there,

This is possible in Facets. You can add a sort column and use title formatting to $replace / remove the brackets, sort by that column, and then hide the sort column by decreasing the width of the column header until no longer visible. See post here.

In that example post you would instead be using columns such as -

Track Title: %title%
Track Title Sort: $replace(%title%,'(',,)

Although if you have a %title% column in Facets, I'm not sure how useful it is to sort tracks alphabetically. It might be better to add a %tracknumber% column and sort by that(?), or just display tracks in the playlist.

Cheers

Re: Song title sorting

Reply #2
Thanks for the info.

If it can't be done with Playlist View though I might leave it so they're sorted the same way.

Having a title column for Facets and sorting alphabetically has always worked well for me, although I have three Facets configurations under different tabs and each has two panes for grouping. For the first configuration there's an artist pane and a title pane, so I can sort titles alphabetically by artist. That sort of thing.

Cheers.

Re: Song title sorting

Reply #3
Esplaylist also has a separate field for the sort order pattern, but if you don't want to install a new plugin, you can save your desired sort order pattern in preferences->advanced-> display-> standard sort patterns. You will than be able to apply it to any playlist view through the context menu.
I'm late

Re: Song title sorting

Reply #4
After combining advice I managed to get the various bits of fb2k to sort the same way by default.... Well after spending a bit of time trying to work out why the Playlist View right click Sort options were greyed out. I haven't sorted that way before, and I fully expected a Playlist View sort option to be found when right clicking on a playlist tab (why isn't there one?) and eventually I realised the Sort options require the highlighting of the tracks that require sorting. For some reason I went in expecting the Sort options to sort all the tracks in a playlist, so it took a while for the penny to drop.

For anyone who cares, I used the following syntax to remove the non-alphanumeric characters when sorting.
Code: [Select]
$caps($left($replace($stripprefix(%title%),!,,#,,'',, ,,'(',),1))
I followed anamorphic's advice and added an additional (hidden) Facets column for sorting it's own Title column, using the syntax above.
For "Preferences / Facets / Library Default Sort Order" I used the same syntax and it also replaced the existing title sorting under "Preferences / Advanced / Display / Default Sort Patterns". Including the default sorting methods, the whole thing now looks like this:
Code: [Select]
File Path=%path_sort%;Artist=%artist%|%date%;Album=%album%|%discnumber%|%tracknumber%;Track Number=%discnumber%|%tracknumber%;Title=$caps($cut($replace($stripprefix(%title%),!,,#,,'',, ,,'(',),1))

And I added $swapprefix to my Facets and Playlist View title columns to make the sorting a little better. Something like:
Code: [Select]
[$swapprefix(%title%)]

The only minor annoyances are numerical sorting (titles beginning with numbers) isn't quite the same as when they're sorted by title, and titles beginning with a non-alphanumeric character are always placed at the top of the tracks beginning with the same letter. For example, a track with a title such as "(Try A little) Tenderness" is placed before any other titles beginning with "T," rather than being sorted strictly alphabetically, but it's definitely better than it was.

Thanks guys.

Re: Song title sorting

Reply #5
[...] titles beginning with a non-alphanumeric character are always placed at the top of the tracks beginning with the same letter. For example, a track with a title such as "(Try A little) Tenderness" is placed before any other titles beginning with "T," rather than being sorted strictly alphabetically, but it's definitely better than it was.
Perhaps is it because you have a $left / $cut in there? (reducing %title% to one letter)

 

Re: Song title sorting

Reply #6
It's incredibly obvious now you've pointed it out. I must've been stuck in the same mindset as here.
Idiot of the day award goes to me.

Cheers.

 
SimplePortal 1.0.0 RC1 © 2008-2019