From 9cdfaacd0243059e8411984f55202048624bf0c3 Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Thu, 29 Apr 2021 15:25:27 +0900 Subject: [PATCH] Fixed the length of bundle_key to 3-digit [Problem] Playlist is sorted to 1 - 10 - 11 - ... - 2 - 3(character sorting), but wanted to be sorted like 1 - 2 - 3 - ... - 10 - 11. [Cause] The bundle_key is character, the length of bundle_key doesn't affects sorting. [Solution] Fixed the length of bundle_key to 3-digit(3-character). Change-Id: I16b3b59f213f368c9f8203b15acd44b6d370b2c1 --- src/media_controller_playlist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/media_controller_playlist.c b/src/media_controller_playlist.c index c3fd4a6..634bf3c 100644 --- a/src/media_controller_playlist.c +++ b/src/media_controller_playlist.c @@ -66,7 +66,8 @@ static int __get_bundle_data(GList *playlist, bundle_raw **bundle_data, int *bun continue; } - bundle_key = g_strdup_printf("%d", ++index); + // due to MAX_PLAYLIST_LEN limit, the 'index' is set to 100 or less. + bundle_key = g_strdup_printf("%03d", ++index); bundle_meta = g_strdup_printf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", item->index, MC_STRING_DELIMITER, -- 2.7.4