(menu_displaylist.c) Sort playlist before parsing

This commit is contained in:
Higor Eurípedes 2015-06-11 10:15:36 -03:00
parent a0457d77f3
commit 7e2a01b9aa

View File

@ -1359,6 +1359,12 @@ static void menu_displaylist_push_horizontal_menu_list_content(
}
#endif
static int menu_displaylist_sort_playlist(const content_playlist_entry_t *a,
const content_playlist_entry_t *b)
{
return strcasecmp(a->label, b->label);
}
static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
{
char db_path[PATH_MAX_LENGTH];
@ -1402,6 +1408,8 @@ static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
strlcpy(path_playlist, "collection", sizeof(path_playlist));
playlist = menu->playlist;
content_playlist_qsort(playlist, menu_displaylist_sort_playlist);
menu_displaylist_parse_playlist(info, playlist, path_playlist, false);
return 0;