diff --git a/command.c b/command.c index 5f79d17da5..c6702983ce 100644 --- a/command.c +++ b/command.c @@ -2102,23 +2102,74 @@ bool command_event(enum event_command cmd, void *data) return false; break; case CMD_EVENT_HISTORY_DEINIT: - if (g_defaults.history) + if (g_defaults.content_history) { - playlist_write_file(g_defaults.history); - playlist_free(g_defaults.history); + playlist_write_file(g_defaults.content_history); + playlist_free(g_defaults.content_history); } - g_defaults.history = NULL; + g_defaults.content_history = NULL; + +#ifdef HAVE_FFMPEG + if (g_defaults.video_history) + { + playlist_write_file(g_defaults.video_history); + playlist_free(g_defaults.video_history); + } + g_defaults.video_history = NULL; + + if (g_defaults.music_history) + { + playlist_write_file(g_defaults.music_history); + playlist_free(g_defaults.music_history); + } + g_defaults.music_history = NULL; +#endif + +#ifdef HAVE_IMAGEVIEWER + if (g_defaults.image_history) + { + playlist_write_file(g_defaults.image_history); + playlist_free(g_defaults.image_history); + } + g_defaults.image_history = NULL; +#endif break; case CMD_EVENT_HISTORY_INIT: command_event(CMD_EVENT_HISTORY_DEINIT, NULL); if (!settings->history_list_enable) return false; + RARCH_LOG("%s: [%s].\n", msg_hash_to_str(MSG_LOADING_HISTORY_FILE), settings->path.content_history); - g_defaults.history = playlist_init( + g_defaults.content_history = playlist_init( settings->path.content_history, settings->content_history_size); + +#ifdef HAVE_FFMPEG + RARCH_LOG("%s: [%s].\n", + msg_hash_to_str(MSG_LOADING_HISTORY_FILE), + settings->path.content_music_history); + g_defaults.music_history = playlist_init( + settings->path.content_music_history, + settings->content_history_size); + + RARCH_LOG("%s: [%s].\n", + msg_hash_to_str(MSG_LOADING_HISTORY_FILE), + settings->path.content_video_history); + g_defaults.video_history = playlist_init( + settings->path.content_video_history, + settings->content_history_size); +#endif + +#ifdef HAVE_IMAGEVIEWER + RARCH_LOG("%s: [%s].\n", + msg_hash_to_str(MSG_LOADING_HISTORY_FILE), + settings->path.content_image_history); + g_defaults.image_history = playlist_init( + settings->path.content_image_history, + settings->content_history_size); +#endif break; case CMD_EVENT_CORE_INFO_DEINIT: core_info_deinit_list(); diff --git a/defaults.h b/defaults.h index 466cfb1128..658dbba210 100644 --- a/defaults.h +++ b/defaults.h @@ -84,7 +84,14 @@ struct defaults } settings; #ifndef IS_SALAMANDER - playlist_t *history; + playlist_t *content_history; +#ifdef HAVE_IMAGEVIEWER + playlist_t *image_history; +#endif +#ifdef HAVE_FFMPEG + playlist_t *video_history; + playlist_t *music_history; +#endif #endif }; diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index 939bb1e211..8c5a0e3e44 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -2844,6 +2844,8 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg) switch (msg) { + case MSG_LOADING_HISTORY_FILE: + return "Loading history file"; case MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON_SIMPLIFIED: return "Ribbon (simplified)"; case MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON: diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 21744953ac..3a35ca4a5c 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1011,7 +1011,7 @@ static int action_ok_playlist_entry(const char *path, size_t selection; menu_content_ctx_playlist_info_t playlist_info; size_t selection_ptr = 0; - playlist_t *playlist = g_defaults.history; + playlist_t *playlist = g_defaults.content_history; const char *entry_path = NULL; const char *entry_label = NULL; const char *core_path = NULL; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 5b9e508e2f..22620ded4e 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5476,7 +5476,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) if (settings->history_list_enable) { char path_playlist[PATH_MAX_LENGTH] = {0}; - playlist_t *playlist = g_defaults.history; + playlist_t *playlist = g_defaults.content_history; if (!playlist) command_event(CMD_EVENT_HISTORY_INIT, NULL); diff --git a/tasks/task_content.c b/tasks/task_content.c index 9e263dd67e..f781751106 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1667,7 +1667,7 @@ static bool task_load_content(content_ctx_info_t *content_info, if (info && *tmp) { - playlist_t *playlist_tmp = g_defaults.history; + playlist_t *playlist_tmp = g_defaults.content_history; if (content_push_to_history_playlist(playlist_tmp, tmp, info, mode)) playlist_write_file(playlist_tmp);