Skip to content

Commit 8ae0580

Browse files
committed
menu_displaylist: display releasemonth as a string rather than int
1 parent 264670e commit 8ae0580

1 file changed

Lines changed: 32 additions & 14 deletions

File tree

menu/menu_displaylist.c

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static int filebrowser_parse(
380380
for (j = 0; j < search_terms->size; j++)
381381
{
382382
const char *search_term = search_terms->terms[j];
383-
if (search_term && *search_term
383+
if (search_term && *search_term
384384
&& !strcasestr(file_path, search_term))
385385
{
386386
skip_entry = true;
@@ -416,7 +416,7 @@ static int filebrowser_parse(
416416
? FILE_TYPE_VIDEO_FONT
417417
: (enum msg_file_type)type_default;
418418

419-
if ( type == DISPLAYLIST_CORES_DETECTED
419+
if ( type == DISPLAYLIST_CORES_DETECTED
420420
&& path_is_compressed_file(file_path))
421421
file_type = FILE_TYPE_CARCHIVE;
422422
break;
@@ -2803,6 +2803,16 @@ static int create_string_list_rdb_entry_int(
28032803
return 0;
28042804
}
28052805

2806+
static char* month_str_to_uint(unsigned month)
2807+
{
2808+
char *months[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
2809+
if (month < 1 || month > 12) {
2810+
RARCH_LOG("Found invalid month number in database entry, got %d", month);
2811+
return NULL;
2812+
}
2813+
return months[month];
2814+
}
2815+
28062816
static int menu_displaylist_parse_database_entry(menu_handle_t *menu,
28072817
menu_displaylist_info_t *info,
28082818
bool show_advanced_settings,
@@ -3060,8 +3070,16 @@ static int menu_displaylist_parse_database_entry(menu_handle_t *menu,
30603070
RDB_ENTRY_INT(edge_magazine_issue, MENU_ENUM_LABEL_RDB_ENTRY_EDGE_MAGAZINE_ISSUE,
30613071
MENU_ENUM_LABEL_VALUE_RDB_ENTRY_EDGE_MAGAZINE_ISSUE)
30623072

3063-
RDB_ENTRY_INT(releasemonth, MENU_ENUM_LABEL_RDB_ENTRY_RELEASE_MONTH,
3064-
MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_MONTH)
3073+
if (db_info_entry->releasemonth)
3074+
{
3075+
if (create_string_list_rdb_entry_string(
3076+
MENU_ENUM_LABEL_RDB_ENTRY_RELEASE_MONTH,
3077+
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_MONTH),
3078+
msg_hash_to_str(MENU_ENUM_LABEL_RDB_ENTRY_RELEASE_MONTH),
3079+
month_str_to_uint(db_info_entry->releasemonth), info->path, info->list) == -1)
3080+
goto error;
3081+
}
3082+
30653083
RDB_ENTRY_INT(releaseyear, MENU_ENUM_LABEL_RDB_ENTRY_RELEASE_YEAR,
30663084
MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_YEAR)
30673085

@@ -3961,17 +3979,17 @@ static int menu_displaylist_parse_horizontal_content_actions(
39613979
|| string_ends_with_size(menu_st->thumbnail_path_data->system, "_history",
39623980
menu_st->thumbnail_path_data->system_len, STRLEN_CONST("_history"));
39633981

3964-
/* An annoyance: if the user navigates to the
3965-
* information menu, then to the database entry,
3982+
/* An annoyance: if the user navigates to the
3983+
* information menu, then to the database entry,
39663984
* the thumbnail system will be changed.
3967-
* This breaks the above 'remove_entry_enabled'
3968-
* check for the history and favorites playlists.
3969-
* We therefore have to check the playlist file
3985+
* This breaks the above 'remove_entry_enabled'
3986+
* check for the history and favorites playlists.
3987+
* We therefore have to check the playlist file
39703988
* name as well... */
39713989
if ( !remove_entry_enabled
39723990
&& settings->bools.quick_menu_show_information
39733991
&& (playlist_file && *playlist_file))
3974-
remove_entry_enabled =
3992+
remove_entry_enabled =
39753993
string_is_equal(playlist_file, FILE_PATH_CONTENT_HISTORY)
39763994
|| string_is_equal(playlist_file, FILE_PATH_CONTENT_FAVORITES);
39773995
}
@@ -5112,7 +5130,7 @@ static unsigned menu_displaylist_parse_content_information(
51125130

51135131
if (core_info_find(core_path, &core_info))
51145132
{
5115-
core_supports_no_game = (core_info->flags
5133+
core_supports_no_game = (core_info->flags
51165134
& CORE_INFO_FLAG_SUPPORTS_NO_GAME);
51175135
if (core_info->display_name && *core_info->display_name)
51185136
strlcpy(core_name, core_info->display_name, sizeof(core_name));
@@ -9768,8 +9786,8 @@ unsigned menu_displaylist_build_list(
97689786
build_list[i].checked = (gfx_widgets && !cheevos_autopad);
97699787
break;
97709788
case MENU_ENUM_LABEL_CHEEVOS_APPEARANCE_PADDING_H:
9771-
build_list[i].checked = ((gfx_widgets && !cheevos_autopad) &&
9772-
!(cheevos_anchor == CHEEVOS_APPEARANCE_ANCHOR_TOPCENTER ||
9789+
build_list[i].checked = ((gfx_widgets && !cheevos_autopad) &&
9790+
!(cheevos_anchor == CHEEVOS_APPEARANCE_ANCHOR_TOPCENTER ||
97739791
cheevos_anchor == CHEEVOS_APPEARANCE_ANCHOR_BOTTOMCENTER));
97749792
break;
97759793
default:
@@ -15492,7 +15510,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
1549215510
if (settings->bools.menu_show_load_core)
1549315511
{
1549415512
#ifdef HAVE_DYNAMIC
15495-
if ( sys_info->info.library_name
15513+
if ( sys_info->info.library_name
1549615514
&& *sys_info->info.library_name)
1549715515
{
1549815516
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list,

0 commit comments

Comments
 (0)