Fixed the length of bundle_key to 3-digit 65/257665/2 accepted/tizen/unified/20210430.052702 submit/tizen/20210429.234105
authorjiyong.min <jiyong.min@samsung.com>
Thu, 29 Apr 2021 06:25:27 +0000 (15:25 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Thu, 29 Apr 2021 07:14:22 +0000 (16:14 +0900)
[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

index c3fd4a6..634bf3c 100644 (file)
@@ -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,