diff --git a/command.c b/command.c index d40ed14906..ac088b7fdb 100644 --- a/command.c +++ b/command.c @@ -1709,19 +1709,12 @@ void command_playlist_push_write( const char *core_path, const char *core_name) { - playlist_t *plist = (playlist_t*)data; - playlist_t *playlist = NULL; + playlist_t *playlist = (playlist_t*)data; - if (plist) - playlist = plist; -#ifdef HAVE_MENU - else - menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); -#endif if (!playlist) return; - playlist_push( + if (playlist_push( playlist, path, label, @@ -1729,8 +1722,8 @@ void command_playlist_push_write( core_name, NULL, NULL - ); - playlist_write_file(playlist); + )) + playlist_write_file(playlist); } void command_playlist_update_write( diff --git a/tasks/task_content.c b/tasks/task_content.c index d82d912e34..4c88634f49 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -961,18 +961,14 @@ static bool task_load_content(content_ctx_info_t *content_info, label = global->name.label; if ( - content_ctx->history_list_enable - && playlist_tmp - && playlist_push( + content_ctx->history_list_enable + && playlist_tmp) + command_playlist_push_write( playlist_tmp, tmp, label, core_path, - core_name, - NULL, - NULL) - ) - playlist_write_file(playlist_tmp); + core_name); } free(tmp); diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 7646ec2343..12f0885463 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -49,6 +49,7 @@ #endif #include "../defaults.h" +#include "../command.h" #include "../configuration.h" #include "../retroarch.h" #include "../paths.h" @@ -163,18 +164,12 @@ static void task_screenshot_handler(retro_task_t *task) state->history_list_enable && g_defaults.image_history ) - { - if (playlist_push( - g_defaults.image_history, - state->filename, - NULL, - "builtin", - "imageviewer", - NULL, - NULL - )) - playlist_write_file(g_defaults.image_history); - } + command_playlist_push_write( + g_defaults.image_history, + state->filename, + NULL, + "builtin", + "imageviewer"); #endif task_set_progress(task, 100);