Skip to content

Commit 32ed9b6

Browse files
authored
플레이리스트 롬파일 이름으로 썸네일 이미지를 찾도록 옵션 추가 (#15731)
1 parent ea86be0 commit 32ed9b6

10 files changed

Lines changed: 63 additions & 1 deletion

config.def.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,8 @@
14391439

14401440
#define DEFAULT_PLAYLIST_PORTABLE_PATHS false
14411441

1442+
#define DEFAULT_PLAYLIST_USE_FILENAME false
1443+
14421444
/* Show Menu start-up screen on boot. */
14431445
#define DEFAULT_MENU_SHOW_START_SCREEN true
14441446

configuration.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,7 @@ static struct config_bool_setting *populate_settings_bool(
20832083
SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, DEFAULT_PLAYLIST_SORT_ALPHABETICAL, false);
20842084
SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, DEFAULT_PLAYLIST_FUZZY_ARCHIVE_MATCH, false);
20852085
SETTING_BOOL("playlist_portable_paths", &settings->bools.playlist_portable_paths, true, DEFAULT_PLAYLIST_PORTABLE_PATHS, false);
2086+
SETTING_BOOL("playlist_use_filename", &settings->bools.playlist_use_filename, true, DEFAULT_PLAYLIST_USE_FILENAME, false);
20862087

20872088
SETTING_BOOL("frame_time_counter_reset_after_fastforwarding", &settings->bools.frame_time_counter_reset_after_fastforwarding, true, false, false);
20882089
SETTING_BOOL("frame_time_counter_reset_after_load_state", &settings->bools.frame_time_counter_reset_after_load_state, true, false, false);

configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ typedef struct settings
992992
bool playlist_show_entry_idx;
993993
bool playlist_fuzzy_archive_match;
994994
bool playlist_portable_paths;
995+
bool playlist_use_filename;
995996

996997
bool quit_press_twice;
997998
bool vibrate_on_keypress;

gfx/gfx_thumbnail_path.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ bool gfx_thumbnail_set_content_playlist(
380380
const char *core_name = NULL;
381381
const char *db_name = NULL;
382382
const struct playlist_entry *entry = NULL;
383+
settings_t* settings = config_get_ptr();
383384

384385
if (!path_data)
385386
return false;
@@ -443,8 +444,26 @@ bool gfx_thumbnail_set_content_playlist(
443444
"", sizeof(path_data->content_label));
444445

445446
/* Determine content image name */
446-
gfx_thumbnail_fill_content_img(path_data->content_img,
447+
if (settings->bools.playlist_use_filename)
448+
{
449+
char* content_name_no_ext = NULL;
450+
char tmp_buf[PATH_MAX_LENGTH];
451+
/* Remove rom file extension
452+
* > path_remove_extension() requires a char * (not const)
453+
* so have to use a temporary buffer... */
454+
455+
const char* base_name = path_basename(path_data->content_path);
456+
strlcpy(tmp_buf, base_name, sizeof(tmp_buf));
457+
content_name_no_ext = path_remove_extension(tmp_buf);
458+
459+
gfx_thumbnail_fill_content_img(path_data->content_img,
460+
sizeof(path_data->content_img), content_name_no_ext);
461+
}
462+
else
463+
{
464+
gfx_thumbnail_fill_content_img(path_data->content_img,
447465
sizeof(path_data->content_img), path_data->content_label);
466+
}
448467

449468
/* Store playlist index */
450469
path_data->playlist_index = idx;

intl/msg_hash_ko.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7356,6 +7356,15 @@ MSG_HASH(
73567356
MENU_ENUM_SUBLABEL_PLAYLIST_PORTABLE_PATHS,
73577357
"활성 및 '파일 탐색기' 디렉토리가 선택되면 '파일 탐색기' 매개 변수의 현재 값이 실행목록에 저장됩니다. 동일 옵션이 활성화 된 다른 시스템에서 실행목록을 불러오면 '파일 탐색기' 매개 변수 값이 실행목록 값과 비교되고 다를 경우 자동으로 교정됩니다."
73587358
)
7359+
MSG_HASH(
7360+
MENU_ENUM_LABEL_VALUE_PLAYLIST_USE_FILENAME,
7361+
"파일이름으로 썸네일 사용"
7362+
)
7363+
MSG_HASH(
7364+
MENU_ENUM_SUBLABEL_PLAYLIST_USE_FILENAME,
7365+
"플레이리스트의 이름 대신 롬 파일이름과 일치하는 썸네일을 사용합니다."
7366+
)
7367+
73597368
MSG_HASH(
73607369
MENU_ENUM_LABEL_VALUE_MANAGE,
73617370
"관리"

intl/msg_hash_us.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7409,6 +7409,14 @@ MSG_HASH(
74097409
"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."
74107410
)
74117411
MSG_HASH(
7412+
MENU_ENUM_LABEL_VALUE_PLAYLIST_USE_FILENAME,
7413+
"Use Filename"
7414+
)
7415+
MSG_HASH(
7416+
MENU_ENUM_SUBLABEL_PLAYLIST_USE_FILENAME,
7417+
"Find thumbnails by rom filename instead of label."
7418+
)
7419+
MSG_HASH(
74127420
MENU_ENUM_LABEL_VALUE_MANAGE,
74137421
"Manage"
74147422
)

menu/cbs/menu_cbs_sublabel.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_fuzzy_archive_match,
12891289
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_use_old_format, MENU_ENUM_SUBLABEL_PLAYLIST_USE_OLD_FORMAT)
12901290
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_compression, MENU_ENUM_SUBLABEL_PLAYLIST_COMPRESSION)
12911291
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_portable_paths, MENU_ENUM_SUBLABEL_PLAYLIST_PORTABLE_PATHS)
1292+
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_use_filename, MENU_ENUM_SUBLABEL_PLAYLIST_USE_FILENAME)
12921293
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_full_width_layout, MENU_ENUM_SUBLABEL_MENU_RGUI_FULL_WIDTH_LAYOUT)
12931294
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_extended_ascii, MENU_ENUM_SUBLABEL_MENU_RGUI_EXTENDED_ASCII)
12941295
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,
53665367
case MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS:
53675368
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_portable_paths);
53685369
break;
5370+
case MENU_ENUM_LABEL_PLAYLIST_USE_FILENAME:
5371+
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_use_filename);
5372+
break;
53695373
case MENU_ENUM_LABEL_PLAYLIST_USE_OLD_FORMAT:
53705374
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_use_old_format);
53715375
break;

menu/menu_displaylist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6705,6 +6705,7 @@ unsigned menu_displaylist_build_list(
67056705
{MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG, PARSE_ONLY_BOOL, true},
67066706
{MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG_AGGREGATE, PARSE_ONLY_BOOL, true},
67076707
{MENU_ENUM_LABEL_PLAYLIST_PORTABLE_PATHS, PARSE_ONLY_BOOL, true},
6708+
{MENU_ENUM_LABEL_PLAYLIST_USE_FILENAME, PARSE_ONLY_BOOL, true},
67086709
#ifdef HAVE_NETWORKING
67096710
{MENU_ENUM_LABEL_NETWORK_ON_DEMAND_THUMBNAILS, PARSE_ONLY_BOOL, true},
67106711
#endif

menu/menu_setting.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20634,6 +20634,22 @@ static bool setting_append_list(
2063420634
SD_FLAG_NONE
2063520635
);
2063620636

20637+
CONFIG_BOOL(
20638+
list, list_info,
20639+
&settings->bools.playlist_use_filename,
20640+
MENU_ENUM_LABEL_PLAYLIST_USE_FILENAME,
20641+
MENU_ENUM_LABEL_VALUE_PLAYLIST_USE_FILENAME,
20642+
DEFAULT_PLAYLIST_USE_FILENAME,
20643+
MENU_ENUM_LABEL_VALUE_OFF,
20644+
MENU_ENUM_LABEL_VALUE_ON,
20645+
&group_info,
20646+
&subgroup_info,
20647+
parent_group,
20648+
general_write_handler,
20649+
general_read_handler,
20650+
SD_FLAG_NONE
20651+
);
20652+
2063720653
#if defined(HAVE_OZONE) || defined(HAVE_XMB)
2063820654
if (string_is_equal(settings->arrays.menu_driver, "ozone") ||
2063920655
string_is_equal(settings->arrays.menu_driver, "xmb"))

msg_hash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,6 +3952,7 @@ enum msg_hash_enums
39523952
MENU_LABEL(PLAYLIST_SUBLABEL_RUNTIME_TYPE),
39533953
MENU_LABEL(PLAYLIST_SUBLABEL_LAST_PLAYED_STYLE),
39543954
MENU_LABEL(PLAYLIST_PORTABLE_PATHS),
3955+
MENU_LABEL(PLAYLIST_USE_FILENAME),
39553956

39563957
MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_HIST_FAV,
39573958
MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_ALWAYS,

0 commit comments

Comments
 (0)