Skip to content

Commit

Permalink
Fix playlists in non-horizontal mode
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Oct 4, 2017
1 parent 1763a2e commit bb6ca3e
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 13 deletions.
2 changes: 2 additions & 0 deletions intl/msg_hash_lbl.h
Expand Up @@ -229,6 +229,8 @@ MSG_HASH(MENU_ENUM_LABEL_DATABASE_MANAGER,
"database_manager")
MSG_HASH(MENU_ENUM_LABEL_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,
"deferred_favorites_list")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST,
Expand Down
12 changes: 12 additions & 0 deletions menu/cbs/menu_cbs_deferred_push.c
Expand Up @@ -901,6 +901,12 @@ static int deferred_push_detect_core_list(menu_displaylist_info_t *info)
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)
{
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
Expand Down Expand Up @@ -1195,6 +1201,12 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_music_history_list);
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 (
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST)))
{
Expand Down
23 changes: 12 additions & 11 deletions menu/cbs/menu_cbs_ok.c
Expand Up @@ -180,15 +180,6 @@ int generic_action_ok_displaylist_push(const char *path,
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST;
dl_type = DISPLAYLIST_GENERIC;
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:
info.type = type;
info.directory_ptr = idx;
Expand Down Expand Up @@ -381,13 +372,23 @@ int generic_action_ok_displaylist_push(const char *path,
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
break;
case ACTION_OK_DL_PLAYLIST_COLLECTION:
filebrowser_clear_type();
info.type = type;
info.directory_ptr = idx;
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;
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:
filebrowser_clear_type();
info.type = type;
Expand Down
20 changes: 18 additions & 2 deletions menu/menu_displaylist.c
Expand Up @@ -3628,8 +3628,11 @@ static int menu_displaylist_parse_playlists(

file_type = FILE_TYPE_PLAYLIST_COLLECTION;

if (!string_is_empty(path))
path = path_basename(path);
if (horizontal)
{
if (!string_is_empty(path))
path = path_basename(path);
}

items_found++;
menu_entries_append_enum(info->list, path, label,
Expand Down Expand Up @@ -6773,6 +6776,19 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
}
use_filebrowser = true;
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:
#ifdef HAVE_IMAGEVIEWER
if (settings->bools.history_list_enable)
Expand Down
1 change: 1 addition & 0 deletions menu/menu_displaylist.h
Expand Up @@ -62,6 +62,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS,
DISPLAYLIST_HISTORY,
DISPLAYLIST_FAVORITES,
DISPLAYLIST_PLAYLIST,
DISPLAYLIST_VIDEO_HISTORY,
DISPLAYLIST_MUSIC_HISTORY,
DISPLAYLIST_IMAGES_HISTORY,
Expand Down
1 change: 1 addition & 0 deletions msg_hash.h
Expand Up @@ -840,6 +840,7 @@ enum msg_hash_enums
MENU_LABEL(BROWSE_START),
/* Deferred */
MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST,
MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST,
MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST,
MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST,
MENU_ENUM_LABEL_DEFERRED_VIDEO_LIST,
Expand Down

0 comments on commit bb6ca3e

Please sign in to comment.