From: jiyong.min Date: Thu, 29 Apr 2021 06:25:27 +0000 (+0900) Subject: Fixed the length of bundle_key to 3-digit X-Git-Tag: submit/tizen/20210429.234105^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cdfaacd0243059e8411984f55202048624bf0c3;p=platform%2Fcore%2Fapi%2Fmedia-controller.git 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 --- 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,