Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Tracknum sort order in Database
« previous next »
  • Print
Pages: [1]

Author Topic: Tracknum sort order in Database  (Read 4718 times)

Offline TheEther

  • Member
  • *
  • Posts: 2
Tracknum sort order in Database
« on: March 01, 2007, 01:55:38 AM »
I've searched and read all of the posts I could identify so far concerning the Track/Tracknum ID3 tag value when using the Database.  I have todays build on an IPOD 5.5 30G.

The Database does correctly sort my tracks using the Tracknum value when viewing tracks by artist>album.  The problem I have is that I have albums that have more than 200 tracks that require that specific order (it works correctly on IPOD OS).  The Rockbox database only sorts by tracknum correctly when there are less than 99 tracks in an album .  Let me demonstrate the issue:

Under normal curcumstacnes when one has 99 tracks or less in an album it looks like this on sort by tracknum:

01
02
03
04
05
06
07
08
09
10
11
12
13
......and so on up to 99, exactly as it should be.....

However, when there are more than 99 tracks it does the following on sort by tracknum:

01
02
03
04
05
06
07
08
09
10
100
101
102
103
104
105
106
107
108
109
11
110
111
...and so on.


Is this a bug or is there something I can adjust to properly handle the files?

Thanks

TheEther
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Tracknum sort order in Database
« Reply #1 on: March 01, 2007, 03:32:03 AM »
It's because the sorting is done using the tracknum as a string, not as an integer and is formatted to two digits.

Do this:
Go into .rockbox/tagnavi.config

Change this line:
%format "fmt_title"       "%02d. %s" tracknum title ? tracknum > "0"
to
%format "fmt_title"       "%03d. %s" tracknum title ? tracknum > "0"

And any others where the tracknum format is %02d

Bear in mind that unless you change to a custom tagnavi file (see my sig), this change will be lost every time you update your build.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline TheEther

  • Member
  • *
  • Posts: 2
Re: Tracknum sort order in Database
« Reply #2 on: March 01, 2007, 08:32:18 AM »
Much appreciated, I changed it and it works correctly now!

Thanks

The Ether..
Logged

Offline Lars

  • Member
  • *
  • Posts: 3
Re: Tracknum sort order in Database
« Reply #3 on: March 21, 2007, 06:38:57 PM »
If I try to change those format values in the "tagnavi_custom.config" they seem to have no efcect. Could it be that format values can't be changed in that navi files after they have been defined?

Regards, Lars
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Tracknum sort order in Database
« Reply #4 on: March 22, 2007, 04:23:49 AM »
Quote from: Lars on March 21, 2007, 06:38:57 PM
If I try to change those format values in the "tagnavi_custom.config" they seem to have no effect. Could it be that format values can't be changed in that navi files after they have been defined?

Regards, Lars

If you are using the same format name, then yes. Rockbox uses the first instance of the format that meet the criteria.

Quote from: http://www.rockbox.org/twiki/bin/view/Main/DataBase#tagnavi_config_v2_0_Syntax
%format "fmt_title"       "%02d. %s" tracknum title ? tracknum > "0"
%format "fmt_title"       "%s" title
It is possible to use the same fmt_identifier with different definitions.
The first line where the condition is true is applied, so it is suggested to use an unconditional line as a "catch all" at the end.

So if you have a third definition of "fmt_title" in your tagnavi_custom.config, it will be third on that list and never get triggered.

As you use a custom file, it would be better to define your own formats
e.g., "custom_title"       "%03d. %s" tracknum title ? tracknum > "0"
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline adam917

  • Member
  • *
  • Posts: 124
Re: Tracknum sort order in Database
« Reply #5 on: March 22, 2007, 03:48:54 PM »
Even though this may be a bit off-topic, is it possible for an application to scan all track number tags in someone's music collection and prefix the tags with the desired number of digits as needed by each album (like prefix three zeroes on tracks 1 to 9, two zeroes on tracks 10 to 99, and one zero on tracks 100 to 999, for instance)?

Besides something like that, are there any true benefits with the DB scanning the track number tags (but still outputing them in WPS & tag info screens as strings) as textual strings as opposed to (cardinal) numeric values? If so, can anyone who knows indicate? Would it have to do with track 'numbers' like 1a, 1b, etc?
Logged

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Tracknum sort order in Database
« Reply #6 on: March 22, 2007, 04:22:08 PM »
MP3Tag is your friend (link)

And, of course, the database formatting described above does exactly that, but only within the database itself.
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Tracknum sort order in Database
« Reply #7 on: March 22, 2007, 04:26:11 PM »
Quote from: adam917 on March 22, 2007, 03:48:54 PM
Besides something like that, are there any true benefits with the DB scanning the track number tags (but still outputing them in WPS & tag info screens as strings) as textual strings as opposed to (cardinal) numeric values? If so, can anyone who knows indicate? Would it have to do with track 'numbers' like 1a, 1b, etc?

Personally I would like to treat track numbers (and year) consistently in database and WPS/info screen and cardinal numbers would be fine with me (that's what my tags are). But some people like the flexibility of having free text to store things like 1/10  or even more obscure things with classical music (there is even a comment in id3.c to that effect).

Now one could make the database use the string representation as well, but numbers are a lot more efficient to deal with and using strings would cause even more sorting problems (i.e. is 02 < 1 ?).

So I think the current compromise is as good as it gets.
Logged

Offline adam917

  • Member
  • *
  • Posts: 124
Re: Tracknum sort order in Database
« Reply #8 on: March 22, 2007, 06:13:54 PM »
Exact what is the current compromise? String in WPS & integer in DB?

Posted by: roolku -
Quote
So I think the current compromise is as good as it gets.

Logged

Offline roolku

  • Developer
  • Member
  • *
  • Posts: 350
Re: Tracknum sort order in Database
« Reply #9 on: March 23, 2007, 05:25:30 AM »
Quote from: adam917 on March 22, 2007, 06:13:54 PM
Exact what is the current compromise? String in WPS & integer in DB?

Nearly. WPS uses whatever the Tag (depending on filetype) holds (number or string) and database uses numbers.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Tracknum sort order in Database
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.094 seconds with 15 queries.