Fix playlists in non-horizontal mode

This commit is contained in:
twinaphex 2017-10-04 08:26:41 +02:00
parent 1763a2ef7b
commit bb6ca3e4ff
6 changed files with 46 additions and 13 deletions

View file

@ -229,6 +229,8 @@ MSG_HASH(MENU_ENUM_LABEL_DATABASE_MANAGER,
"database_manager") "database_manager")
MSG_HASH(MENU_ENUM_LABEL_DATABASE_MANAGER_LIST, MSG_HASH(MENU_ENUM_LABEL_DATABASE_MANAGER_LIST,
"database_manager_list") "database_manager_list")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST,
"deferred_playlist_list")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST, MSG_HASH(MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST,
"deferred_favorites_list") "deferred_favorites_list")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST, MSG_HASH(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST,

View file

@ -901,6 +901,12 @@ static int deferred_push_detect_core_list(menu_displaylist_info_t *info)
DISPLAYLIST_CORES_DETECTED); DISPLAYLIST_CORES_DETECTED);
} }
static int deferred_playlist_list(menu_displaylist_info_t *info)
{
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
return general_push(info, PUSH_DEFAULT, DISPLAYLIST_PLAYLIST);
}
static int deferred_music_history_list(menu_displaylist_info_t *info) static int deferred_music_history_list(menu_displaylist_info_t *info)
{ {
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
@ -1195,6 +1201,12 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_music_history_list); BIND_ACTION_DEFERRED_PUSH(cbs, deferred_music_history_list);
return 0; return 0;
} }
else if (
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_playlist_list);
return 0;
}
else if ( else if (
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST))) string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST)))
{ {

View file

@ -180,15 +180,6 @@ int generic_action_ok_displaylist_push(const char *path,
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST; info.enum_idx = MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST;
dl_type = DISPLAYLIST_GENERIC; dl_type = DISPLAYLIST_GENERIC;
break; break;
case ACTION_OK_DL_MUSIC_LIST:
info.type = type;
info.directory_ptr = idx;
info_path = label;
info_label = msg_hash_to_str(
MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_VIDEO_LIST: case ACTION_OK_DL_VIDEO_LIST:
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
@ -381,13 +372,23 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE; dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break; break;
case ACTION_OK_DL_PLAYLIST_COLLECTION: case ACTION_OK_DL_PLAYLIST_COLLECTION:
filebrowser_clear_type();
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
info_path = path; info_path = path;
info_label = label; info_label = msg_hash_to_str(
MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST;
dl_type = DISPLAYLIST_GENERIC; dl_type = DISPLAYLIST_GENERIC;
break; break;
case ACTION_OK_DL_MUSIC_LIST:
info.type = type;
info.directory_ptr = idx;
info_path = label;
info_label = msg_hash_to_str(
MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_CHEAT_FILE: case ACTION_OK_DL_CHEAT_FILE:
filebrowser_clear_type(); filebrowser_clear_type();
info.type = type; info.type = type;

View file

@ -3628,8 +3628,11 @@ static int menu_displaylist_parse_playlists(
file_type = FILE_TYPE_PLAYLIST_COLLECTION; file_type = FILE_TYPE_PLAYLIST_COLLECTION;
if (!string_is_empty(path)) if (horizontal)
path = path_basename(path); {
if (!string_is_empty(path))
path = path_basename(path);
}
items_found++; items_found++;
menu_entries_append_enum(info->list, path, label, menu_entries_append_enum(info->list, path, label,
@ -6773,6 +6776,19 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
} }
use_filebrowser = true; use_filebrowser = true;
break; break;
case DISPLAYLIST_PLAYLIST:
menu_displaylist_parse_playlist_generic(menu, info,
path_basename(info->path),
info->path,
&ret);
ret = 0;
if (ret == 0)
{
info->need_refresh = true;
info->need_push = true;
}
break;
case DISPLAYLIST_IMAGES_HISTORY: case DISPLAYLIST_IMAGES_HISTORY:
#ifdef HAVE_IMAGEVIEWER #ifdef HAVE_IMAGEVIEWER
if (settings->bools.history_list_enable) if (settings->bools.history_list_enable)

View file

@ -62,6 +62,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS,
DISPLAYLIST_HISTORY, DISPLAYLIST_HISTORY,
DISPLAYLIST_FAVORITES, DISPLAYLIST_FAVORITES,
DISPLAYLIST_PLAYLIST,
DISPLAYLIST_VIDEO_HISTORY, DISPLAYLIST_VIDEO_HISTORY,
DISPLAYLIST_MUSIC_HISTORY, DISPLAYLIST_MUSIC_HISTORY,
DISPLAYLIST_IMAGES_HISTORY, DISPLAYLIST_IMAGES_HISTORY,

View file

@ -840,6 +840,7 @@ enum msg_hash_enums
MENU_LABEL(BROWSE_START), MENU_LABEL(BROWSE_START),
/* Deferred */ /* Deferred */
MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST, MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST,
MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST,
MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST, MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST,
MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST, MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST,
MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST, MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST,