Rockbox Technical Forums

Support and General Use => User Interface and Voice => Topic started by: bloodyraoul on July 25, 2007, 03:40:38 PM

Title: Tagnavi sorting results
Post by: bloodyraoul on July 25, 2007, 03:40:38 PM
Hello,
When you browse database, results are always sorted alphabetically.
Is there a way for sorting them differently, for example, showing a list of all titles ordered by artist and album ?

thankx for your help
Title: Re: Tagnavi sorting results
Post by: bascule on July 25, 2007, 04:11:21 PM
http://www.rockbox.org/twiki/bin/view/Main/WebHome?topic=DataBase
Title: Re: Tagnavi sorting results
Post by: bloodyraoul on July 25, 2007, 05:57:16 PM
I already read the wiki...
maybe i'm not clear, i'll try to explain :
i dont want to have artist -> album -> title ordered alphabetically
but directly titles ordered by artists and album
in fact, when i want to play all tracks, i want le playlist keep the artist and album order instead of playing songs by letter.
is it possible ?

thanx

Title: Re: Tagnavi sorting results
Post by: bascule on July 25, 2007, 06:45:10 PM
No, that is not possible. See this topic we had on  the same subject for more info:

http://forums.rockbox.org/index.php?topic=10148.0
Title: Re: Tagnavi sorting results
Post by: Chronon on July 25, 2007, 08:32:26 PM
If you just want to play your songs by album can't you just choose a song from an album and enable "Auto-Change Directory"?  You won't get a listing like you want, but it seems like playback will proceed like you want it to.
Title: Re: Tagnavi sorting results
Post by: bloodyraoul on July 26, 2007, 02:58:02 AM
If you just want to play your songs by album can't you just choose a song from an album and enable "Auto-Change Directory"?  You won't get a listing like you want, but it seems like playback will proceed like you want it to.

yes it's the only way i find to do this, too
but if i want, for example, to play all album of year 2007, by artist, by album, it's not possible
ok, thx you
Title: Re: Tagnavi sorting results
Post by: Chronon on July 26, 2007, 01:25:20 PM
It seems like you could get the behavior that you want if we had some way of sorting the playlist alphabetically -- at least if your filenames have track numbers at the beginning.  So you could select all tracks from 2007 from the database.  Then sort the paths in the resulting playlist alphabetically to group them by artist/album.  It seems like such a sort feature would be nice to have as part of the playlist functionality anyway.

If there's some agreement that this would be a good way to do this then perhaps a feature request would be in order.
Title: Re: Tagnavi sorting results
Post by: bascule on July 27, 2007, 09:31:26 AM
You should be able to achieve something like you want be writing your own format string and adding it to the tagnavi.config file.

Something like (I can't test this at work :( ):
%format "fmt_sort" "%4d-%s-%s-%s" year artist album title

...and then to view the list:
"Track"    -> title = "fmt_sort"

This should display a list of all tracks, but with the formatting it should be alphabetically sorted year, then artist, then album, then track.
Title: Re: Tagnavi sorting results
Post by: bloodyraoul on July 30, 2007, 03:02:53 PM
You should be able to achieve something like you want be writing your own format string and adding it to the tagnavi.config file.

Something like (I can't test this at work :( ):
%format "fmt_sort" "%4d-%s-%s-%s" year artist album title

...and then to view the list:
"Track"    -> title = "fmt_sort"

This should display a list of all tracks, but with the formatting it should be alphabetically sorted year, then artist, then album, then track.

If I write :
"Artist"   -> artist   -> album  -> title = "fmt_sort"
And then I browse the database, if I select an artist, then an album, the tracks are shown as I want because of the format
But if I select "All tracks" on the Artist screen, it don't apply the track format and show the tracks sorted by title !?
Why ? is there a way ?
Title: Re: Tagnavi sorting results
Post by: bascule on July 30, 2007, 04:09:44 PM
All Tracks always sorts strictly alphabetically, because it's not constrained by the format tag.

I don't believe there is an easy fix, other than patching the source code.
Title: Re: Tagnavi sorting results
Post by: bloodyraoul on July 31, 2007, 03:07:11 AM
ok, but why the format is not applied when you select "all tracks" on an intermediate screen ?
Title: Re: Tagnavi sorting results
Post by: dip on July 31, 2007, 06:57:09 PM
I guess using the format string is not really what you would like to see when selecting "all tracks". A commonly used format string is <"%02d - %s" tracknum title> which sorts the tracks in order of tracknumbers. But that is only reasonable within an album.

When I select "all tracks" I would prefer a sorting of "album - tracknumber" or even "albumartist - album - tracknumber". When the format string would be used for sorting and you are on a browse level of an intermediate screen (showing e.g. all your albums of Elton John) then selecting "all tracks" would result in a track list showing all tracks with tracknumber 1 first, then all tracks with tracknumber 2 and so on.

At the moment you get a list in which all tracks are sorted alphabetically which I also do not like. When I am at an intermediate screen showing all albums of e.g. Elton John, when selecting "all tracks" I would expect a tracklist sorted by albums and then by the format string (which is the tracknumber for me). In this all tracks of the first album would be played first, then all the tracks of the second album and so on.

The same problem exists at the moment when you browse by artist and select a specific artist by pressing long select on the artist name. Then a playlist is created comprising all tracks of the albums of this artist in alphabetical order. However, I would expect a playlist comprising all tracks sorted by the album name first and then by the format string (the tracknumber in my case).

Would it be difficult to patch the source code to change the alphabetical order to an "albumartist - album - format string" order?

Title: Re: Tagnavi sorting results
Post by: dip on August 20, 2007, 10:05:24 AM
Please could any developer or anybody familiar with the source code point to the part of the source code which must be amended to change the sorting order as described above. I would then try to write a patch if it is not too complicated.

Any help would be appreciated very much.
Title: Re: Tagnavi sorting results
Post by: GodEater on August 20, 2007, 11:37:42 AM
If you can't even find the code to modify, the chances of you being able to change it successfully are pretty slim...
Title: Re: Tagnavi sorting results
Post by: dip on August 20, 2007, 11:53:26 AM
I fear you are right. I already looked into the code and found the qsort call in tagree.c but I have to admit that I were not successful in understanding the code completely. Maybe with some helpful hints I could try a little bit more... (or even better I find a helpful person which can easily make the necessary amendments  ;) )