This commit is contained in:
twinaphex 2016-12-16 09:29:43 +01:00
parent 0adeaeaf1e
commit 02e1c141a1

View File

@ -3845,37 +3845,23 @@ static void menu_displaylist_parse_playlist_history(
const char *playlist_path,
int *ret)
{
settings_t *settings = config_get_ptr();
char path_playlist[PATH_MAX_LENGTH];
if (settings->history_list_enable)
{
char path_playlist[PATH_MAX_LENGTH];
path_playlist[0] = '\0';
path_playlist[0] = '\0';
if (!playlist)
command_event(CMD_EVENT_HISTORY_INIT, NULL);
if (!playlist)
command_event(CMD_EVENT_HISTORY_INIT, NULL);
strlcpy(path_playlist, playlist_name, sizeof(path_playlist));
*ret = menu_displaylist_parse_playlist(info,
playlist, path_playlist, true);
strlcpy(
menu->db_playlist_file,
playlist_path,
sizeof(menu->db_playlist_file));
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_FREE, NULL);
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_INIT,
(void*)menu->db_playlist_file);
}
else
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE),
MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE,
MENU_INFO_MESSAGE, 0, 0);
*ret = 0;
}
strlcpy(path_playlist, playlist_name, sizeof(path_playlist));
*ret = menu_displaylist_parse_playlist(info,
playlist, path_playlist, true);
strlcpy(
menu->db_playlist_file,
playlist_path,
sizeof(menu->db_playlist_file));
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_FREE, NULL);
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_INIT,
(void*)menu->db_playlist_file);
}
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
@ -5546,11 +5532,21 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
}
break;
case DISPLAYLIST_HISTORY:
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.content_history,
"history",
settings->path.content_history,
&ret);
if (settings->history_list_enable)
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.content_history,
"history",
settings->path.content_history,
&ret);
else
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE),
MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE,
MENU_INFO_MESSAGE, 0, 0);
ret = 0;
}
if (ret == 0)
{
@ -5560,11 +5556,21 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
break;
case DISPLAYLIST_IMAGES_HISTORY:
#ifdef HAVE_IMAGEVIEWER
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.image_history,
"images_history",
settings->path.content_image_history,
&ret);
if (settings->history_list_enable)
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.image_history,
"images_history",
settings->path.content_image_history,
&ret);
else
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE),
MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE,
MENU_INFO_MESSAGE, 0, 0);
ret = 0;
}
if (ret == 0)
{
@ -5575,11 +5581,21 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
break;
case DISPLAYLIST_MUSIC_HISTORY:
#ifdef HAVE_FFMPEG
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.music_history,
"music_history",
settings->path.content_music_history,
&ret);
if (settings->history_list_enable)
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.music_history,
"music_history",
settings->path.content_music_history,
&ret);
else
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE),
MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE,
MENU_INFO_MESSAGE, 0, 0);
ret = 0;
}
if (ret == 0)
{
@ -5590,11 +5606,21 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
break;
case DISPLAYLIST_VIDEO_HISTORY:
#ifdef HAVE_FFMPEG
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.video_history,
"video_history",
settings->path.content_video_history,
&ret);
if (settings->history_list_enable)
menu_displaylist_parse_playlist_history(menu, info,
g_defaults.video_history,
"video_history",
settings->path.content_video_history,
&ret);
else
{
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE),
MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE,
MENU_INFO_MESSAGE, 0, 0);
ret = 0;
}
if (ret == 0)
{