Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: iPodVT on January 01, 2023, 02:38:37 PM

Title: Custom Track List Is Sorting Alphabetically Only When Fewer Than 1,000 Items
Post by: iPodVT on January 01, 2023, 02:38:37 PM
One of the ways in which I am using tagnavi_custom.config allows me to access various subsets of the tracks in my database based on the directories in which the tracks are located.  Here is a line from my tagnavi_custom.config file for this purpose:

"Track" -> title ? filename ~ "/Rob's iPod" -> title = "fmt_alphanum_title"

I have observed that the resulting list of tracks will sort alphabetically only if there are fewer than 1,000 tracks.  If there are 1,000 or more tracks it does not sort alphabetically.  This does not happen with track lists that are >= 1,000 when derived from the main menu in tagnavi.config:

"Track"    -> title = "fmt_alphanum_title"

Is there a threshold setting somewhere that is causing this?  Or maybe there is a flaw in my above line?

Thanks.
Title: Re: Custom Track List Is Sorting Alphabetically Only When Fewer Than 1,000 Items
Post by: iPodVT on January 01, 2023, 03:47:54 PM
Now I see that when there are 1,000 or more tracks and the track list is not getting sorted alphabetically, Rockbox is seeming to be parsing the subdirectories and listing the tracks in the order in which they are encountered.
Title: Re: Custom Track List Is Sorting Alphabetically Only When Fewer Than 1,000 Items
Post by: chris_s on January 01, 2023, 04:26:48 PM
Is there a threshold setting somewhere that is causing this?

It's determined by the "Max Entries in File Browser (https://download.rockbox.org/daily/manual/rockbox-ipodvideo/rockbox-buildch8.html#x11-1540008.5.3)" setting. Looks like the manual may have to be updated to make that clear.

Be sure to restart after changing the setting before it takes effect.
Title: Re: Custom Track List Is Sorting Alphabetically Only When Fewer Than 1,000 Items
Post by: iPodVT on January 01, 2023, 04:42:00 PM
It's determined by the "Max Entries in File Browser (https://download.rockbox.org/daily/manual/rockbox-ipodvideo/rockbox-buildch8.html#x11-1540008.5.3)" setting. Looks like the manual may have to be updated to make that clear.

Be sure to restart after changing the setting before it takes effect.

Thank you very much.  I upped it to the max allowed - 10,000 - and now everything is sorting all the time.

What happens if/when my number of tracks exceeds 10,000?  Can/should the limit setting be allowed to increase beyond that?  I assume there are plenty of Rockbox users with way more tracks than that.
Title: Re: Custom Track List Is Sorting Alphabetically Only When Fewer Than 1,000 Items
Post by: amachronic on January 01, 2023, 04:49:31 PM
1000 files seems pretty low as a default. Looks like it might be a bit out of date:
Code: [Select]
    INT_SETTING(F_BANFROMQS, max_files_in_dir, LANG_MAX_FILES_IN_DIR,
#if MEMORYSIZE > 1
                  1000,
#else
                  200,
#endif
                  "max files in dir", UNIT_INT, 50, 10000, 50,
                  NULL, NULL, NULL),

Only a handful of low-RAM targets have 2 MB -- everything else is >8 MB, so I'd argue the default limit should be upped quite a bit.

And I don't think there's a problem with increasing the max limit beyond 10,000.
Title: Re: Custom Track List Is Sorting Alphabetically Only When Fewer Than 1,000 Items
Post by: iPodVT on January 01, 2023, 05:14:23 PM
One more technicality:  I previously had the Max Entries In File Browser set at 1,000, but the largest number of tracks that was getting sorted was 999.  So it seems that the setting's test is off by one.