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;
|
const char *core_name = NULL;
|
||||||
playlist_t *tmp_playlist = NULL;
|
playlist_t *tmp_playlist = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = NULL;
|
||||||
|
content_ctx_info_t content_info = {0};
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||||
return menu_cbs_exit();
|
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))
|
if (!menu_content_load_from_playlist(&playlist_info))
|
||||||
return menu_cbs_exit();
|
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();
|
return menu_cbs_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -748,6 +762,7 @@ static int action_ok_playlist_entry(const char *path,
|
||||||
const char *core_name = NULL;
|
const char *core_name = NULL;
|
||||||
playlist_t *tmp_playlist = NULL;
|
playlist_t *tmp_playlist = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = NULL;
|
||||||
|
content_ctx_info_t content_info = {0};
|
||||||
uint32_t hash_label = msg_hash_calculate(label);
|
uint32_t hash_label = msg_hash_calculate(label);
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
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))
|
if (!menu_content_load_from_playlist(&playlist_info))
|
||||||
return menu_cbs_exit();
|
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)
|
if (is_history)
|
||||||
{
|
{
|
||||||
switch (hash_label)
|
switch (hash_label)
|
||||||
|
|
|
@ -46,23 +46,19 @@
|
||||||
**/
|
**/
|
||||||
bool menu_content_load_from_playlist(menu_content_ctx_playlist_info_t *info)
|
bool menu_content_load_from_playlist(menu_content_ctx_playlist_info_t *info)
|
||||||
{
|
{
|
||||||
unsigned idx;
|
|
||||||
playlist_t *playlist = NULL;
|
playlist_t *playlist = NULL;
|
||||||
const char *core_path = NULL;
|
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
content_ctx_info_t content_info = {0};
|
|
||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
playlist = (playlist_t*)info->data;
|
playlist = (playlist_t*)info->data;
|
||||||
idx = info->idx;
|
|
||||||
|
|
||||||
if (!playlist)
|
if (!playlist)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
playlist_get_index(playlist,
|
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))
|
if (!string_is_empty(path))
|
||||||
{
|
{
|
||||||
|
@ -93,15 +89,7 @@ bool menu_content_load_from_playlist(menu_content_ctx_playlist_info_t *info)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task_push_content_load_default(
|
return true;
|
||||||
core_path,
|
|
||||||
path,
|
|
||||||
&content_info,
|
|
||||||
CORE_TYPE_PLAIN,
|
|
||||||
CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU,
|
|
||||||
NULL,
|
|
||||||
NULL))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
runloop_msg_queue_push("File could not be loaded.\n", 1, 100, true);
|
runloop_msg_queue_push("File could not be loaded.\n", 1, 100, true);
|
||||||
|
|
Loading…
Reference in New Issue