diff --git a/config.def.h b/config.def.h index e790e1d791..6d70979883 100644 --- a/config.def.h +++ b/config.def.h @@ -1439,6 +1439,8 @@ #define DEFAULT_PLAYLIST_PORTABLE_PATHS false +#define DEFAULT_PLAYLIST_USE_FILENAME false + /* Show Menu start-up screen on boot. */ #define DEFAULT_MENU_SHOW_START_SCREEN true diff --git a/configuration.c b/configuration.c index 4d364355f5..ba157e34da 100644 --- a/configuration.c +++ b/configuration.c @@ -2083,6 +2083,7 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, DEFAULT_PLAYLIST_SORT_ALPHABETICAL, false); SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false); SETTING_BOOL("playlist_portable_paths", &settings->bools.playlist_portable_paths, true, DEFAULT_PLAYLIST_PORTABLE_PATHS, false); + SETTING_BOOL("playlist_use_filename", &settings->bools.playlist_use_filename, true, DEFAULT_PLAYLIST_USE_FILENAME, false); SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false); SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false); diff --git a/configuration.h b/configuration.h index 3835d27614..899883ba04 100644 --- a/configuration.h +++ b/configuration.h @@ -992,6 +992,7 @@ typedef struct settings bool playlist_show_entry_idx; bool playlist_fuzzy_archive_match; bool playlist_portable_paths; + bool playlist_use_filename; bool quit_press_twice; bool vibrate_on_keypress; diff --git a/gfx/gfx_thumbnail_path.c b/gfx/gfx_thumbnail_path.c index 7f86173547..271bc63fc1 100644 --- a/gfx/gfx_thumbnail_path.c +++ b/gfx/gfx_thumbnail_path.c @@ -380,6 +380,7 @@ bool gfx_thumbnail_set_content_playlist( const char *core_name = NULL; const char *db_name = NULL; const struct playlist_entry *entry = NULL; + settings_t* settings = config_get_ptr(); if (!path_data) return false; @@ -443,8 +444,26 @@ bool gfx_thumbnail_set_content_playlist( "", sizeof(path_data->content_label)); /* Determine content image name */ - gfx_thumbnail_fill_content_img(path_data->content_img, + if (settings->bools.playlist_use_filename) + { + char* content_name_no_ext = NULL; + char tmp_buf[PATH_MAX_LENGTH]; + /* Remove rom file extension + * > path_remove_extension() requires a char * (not const) + * so have to use a temporary buffer... */ + + const char* base_name = path_basename(path_data->content_path); + strlcpy(tmp_buf, base_name, sizeof(tmp_buf)); + content_name_no_ext = path_remove_extension(tmp_buf); + + gfx_thumbnail_fill_content_img(path_data->content_img, + sizeof(path_data->content_img), content_name_no_ext); + } + else + { + gfx_thumbnail_fill_content_img(path_data->content_img, sizeof(path_data->content_img), path_data->content_label); + } /* Store playlist index */ path_data->playlist_index = idx; diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index c002a2b19b..29502c98dc 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -7356,6 +7356,15 @@ MSG_HASH( MENU_ENUM_SUBLABEL_PLAYLIST_PORTABLE_PATHS, "활성 및 '파일 탐색기' 디렉토리가 선택되면 '파일 탐색기' 매개 변수의 현재 값이 실행목록에 저장됩니다. 동일 옵션이 활성화 된 다른 시스템에서 실행목록을 불러오면 '파일 탐색기' 매개 변수 값이 실행목록 값과 비교되고 다를 경우 자동으로 교정됩니다." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_PLAYLIST_USE_FILENAME, + "파일이름으로 썸네일 사용" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_PLAYLIST_USE_FILENAME, + "플레이리스트의 이름 대신 롬 파일이름과 일치하는 썸네일을 사용합니다." + ) + MSG_HASH( MENU_ENUM_LABEL_VALUE_MANAGE, "관리" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 759d720317..f65fed640a 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -7409,6 +7409,14 @@ MSG_HASH( "When enabled, and 'File Browser' directory is also selected, the current value of parameter 'File Browser' is saved in the playlist. When the playlist is loaded on another system where the same option is enabled, the value of parameter 'File Browser' is compared with the playlist value; if different, the playlist entries' paths are automatically fixed." ) MSG_HASH( + MENU_ENUM_LABEL_VALUE_PLAYLIST_USE_FILENAME, + "Use Filename" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_PLAYLIST_USE_FILENAME, + "Find thumbnails by rom filename instead of label." + ) + MSG_HASH( MENU_ENUM_LABEL_VALUE_MANAGE, "Manage" ) diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 7fc6a9252c..7215fbcef5 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -1289,6 +1289,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_fuzzy_archive_match, DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_use_old_format, MENU_ENUM_SUBLABEL_PLAYLIST_USE_OLD_FORMAT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_compression, MENU_ENUM_SUBLABEL_PLAYLIST_COMPRESSION) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_portable_paths, MENU_ENUM_SUBLABEL_PLAYLIST_PORTABLE_PATHS) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_use_filename, MENU_ENUM_SUBLABEL_PLAYLIST_USE_FILENAME) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_full_width_layout, MENU_ENUM_SUBLABEL_MENU_RGUI_FULL_WIDTH_LAYOUT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_extended_ascii, MENU_ENUM_SUBLABEL_MENU_RGUI_EXTENDED_ASCII) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_switch_icons, MENU_ENUM_SUBLABEL_MENU_RGUI_SWITCH_ICONS) @@ -5366,6 +5367,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_portable_paths); break; + case MENU_ENUM_LABEL_PLAYLIST_USE_FILENAME: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_use_filename); + break; case MENU_ENUM_LABEL_PLAYLIST_USE_OLD_FORMAT: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_use_old_format); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index b5a84beb35..cbc8abc241 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -6705,6 +6705,7 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG_AGGREGATE, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS, PARSE_ONLY_BOOL, true}, + {MENU_ENUM_LABEL_PLAYLIST_USE_FILENAME, PARSE_ONLY_BOOL, true}, #ifdef HAVE_NETWORKING {MENU_ENUM_LABEL_NETWORK_ON_DEMAND_THUMBNAILS, PARSE_ONLY_BOOL, true}, #endif diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 25eb15dbe9..0af6d50896 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -20634,6 +20634,22 @@ static bool setting_append_list( SD_FLAG_NONE ); + CONFIG_BOOL( + list, list_info, + &settings->bools.playlist_use_filename, + MENU_ENUM_LABEL_PLAYLIST_USE_FILENAME, + MENU_ENUM_LABEL_VALUE_PLAYLIST_USE_FILENAME, + DEFAULT_PLAYLIST_USE_FILENAME, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE + ); + #if defined(HAVE_OZONE) || defined(HAVE_XMB) if (string_is_equal(settings->arrays.menu_driver, "ozone") || string_is_equal(settings->arrays.menu_driver, "xmb")) diff --git a/msg_hash.h b/msg_hash.h index 30192e2d05..78e2646b67 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -3952,6 +3952,7 @@ enum msg_hash_enums MENU_LABEL(PLAYLIST_SUBLABEL_RUNTIME_TYPE), MENU_LABEL(PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE), MENU_LABEL(PLAYLIST_PORTABLE_PATHS), + MENU_LABEL(PLAYLIST_USE_FILENAME), MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV, MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_ALWAYS,