mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Refactor menu_content_load_from_playlist
This commit is contained in:
parent
9836b97554
commit
471ffc53fd
@ -647,6 +647,7 @@ static int action_ok_playlist_entry_collection(const char *path,
|
||||
const char *core_name = NULL;
|
||||
playlist_t *tmp_playlist = NULL;
|
||||
menu_handle_t *menu = NULL;
|
||||
content_ctx_info_t content_info = {0};
|
||||
|
||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||
return menu_cbs_exit();
|
||||
@ -730,6 +731,19 @@ static int action_ok_playlist_entry_collection(const char *path,
|
||||
if (!menu_content_load_from_playlist(&playlist_info))
|
||||
return menu_cbs_exit();
|
||||
|
||||
playlist_get_index(playlist,
|
||||
playlist_info.idx, &path, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (!task_push_content_load_default(
|
||||
core_path,
|
||||
path,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU,
|
||||
NULL,
|
||||
NULL))
|
||||
return menu_cbs_exit();
|
||||
|
||||
return menu_cbs_exit();
|
||||
}
|
||||
|
||||
@ -748,6 +762,7 @@ static int action_ok_playlist_entry(const char *path,
|
||||
const char *core_name = NULL;
|
||||
playlist_t *tmp_playlist = NULL;
|
||||
menu_handle_t *menu = NULL;
|
||||
content_ctx_info_t content_info = {0};
|
||||
uint32_t hash_label = msg_hash_calculate(label);
|
||||
|
||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||
@ -846,6 +861,19 @@ static int action_ok_playlist_entry(const char *path,
|
||||
if (!menu_content_load_from_playlist(&playlist_info))
|
||||
return menu_cbs_exit();
|
||||
|
||||
playlist_get_index(playlist,
|
||||
playlist_info.idx, &path, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (!task_push_content_load_default(
|
||||
core_path,
|
||||
path,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU,
|
||||
NULL,
|
||||
NULL))
|
||||
return menu_cbs_exit();
|
||||
|
||||
if (is_history)
|
||||
{
|
||||
switch (hash_label)
|
||||
|
@ -46,23 +46,19 @@
|
||||
**/
|
||||
bool menu_content_load_from_playlist(menu_content_ctx_playlist_info_t *info)
|
||||
{
|
||||
unsigned idx;
|
||||
playlist_t *playlist = NULL;
|
||||
const char *core_path = NULL;
|
||||
const char *path = NULL;
|
||||
content_ctx_info_t content_info = {0};
|
||||
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
playlist = (playlist_t*)info->data;
|
||||
idx = info->idx;
|
||||
|
||||
if (!playlist)
|
||||
return false;
|
||||
|
||||
playlist_get_index(playlist,
|
||||
idx, &path, NULL, &core_path, NULL, NULL, NULL);
|
||||
info->idx, &path, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
if (!string_is_empty(path))
|
||||
{
|
||||
@ -93,14 +89,6 @@ bool menu_content_load_from_playlist(menu_content_ctx_playlist_info_t *info)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (task_push_content_load_default(
|
||||
core_path,
|
||||
path,
|
||||
&content_info,
|
||||
CORE_TYPE_PLAIN,
|
||||
CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU,
|
||||
NULL,
|
||||
NULL))
|
||||
return true;
|
||||
|
||||
error:
|
||||
|
Loading…
x
Reference in New Issue
Block a user