플레이리스트 롬파일 이름으로 썸네일 이미지를 찾도록 옵션 추가 (#15731)

This commit is contained in:
bulzipke 2023-09-26 21:31:59 +09:00 committed by GitHub
parent ea86be0a2b
commit 32ed9b6041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 63 additions and 1 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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,
"관리"

View File

@ -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"
)

View File

@ -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;

View File

@ -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

View File

@ -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"))

View File

@ -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,