Remove more settings_t dependencies

This commit is contained in:
twinaphex 2020-02-03 08:00:08 +01:00
parent d3e0d03301
commit cd20966fc8
3 changed files with 12 additions and 7 deletions

View File

@ -6349,7 +6349,7 @@ static int action_ok_pl_content_thumbnails(const char *path,
settings->paths.directory_playlist, label,
sizeof(playlist_path));
task_push_pl_thumbnail_download(path, playlist_path);
task_push_pl_thumbnail_download(path, playlist_path, settings->paths.directory_thumbnails);
return 0;
#else
return -1;

View File

@ -471,22 +471,22 @@ static bool task_pl_thumbnail_finder(retro_task_t *task, void *user_data)
}
bool task_push_pl_thumbnail_download(
const char *system, const char *playlist_path)
const char *system, const char *playlist_path,
const char *dir_thumbnails)
{
task_finder_data_t find_data;
settings_t *settings = config_get_ptr();
retro_task_t *task = task_init();
pl_thumb_handle_t *pl_thumb = (pl_thumb_handle_t*)calloc(1, sizeof(pl_thumb_handle_t));
const char *playlist_file = path_basename(playlist_path);
/* Sanity check */
if (!settings || !task || !pl_thumb)
if (!task || !pl_thumb)
goto error;
if (string_is_empty(system) ||
string_is_empty(playlist_path) ||
string_is_empty(playlist_file) ||
string_is_empty(settings->paths.directory_thumbnails))
string_is_empty(dir_thumbnails))
goto error;
/* Only parse supported playlist types */
@ -518,7 +518,7 @@ bool task_push_pl_thumbnail_download(
/* Configure handle */
pl_thumb->system = strdup(system);
pl_thumb->playlist_path = strdup(playlist_path);
pl_thumb->dir_thumbnails = strdup(settings->paths.directory_thumbnails);
pl_thumb->dir_thumbnails = strdup(dir_thumbnails);
pl_thumb->playlist = NULL;
pl_thumb->thumbnail_path_data = NULL;
pl_thumb->http_task = NULL;
@ -591,6 +591,7 @@ static void cb_task_pl_entry_thumbnail_refresh_menu(
if (string_is_empty(playlist_get_conf_path(current_playlist)))
return;
#ifdef HAVE_MATERIALUI
if (string_is_equal(settings->arrays.menu_driver, "glui"))
{
if (!string_is_equal(pl_thumb->playlist_path,
@ -598,6 +599,7 @@ static void cb_task_pl_entry_thumbnail_refresh_menu(
return;
}
else
#endif
{
if (((pl_thumb->list_index != menu_navigation_get_selection()) &&
(pl_thumb->list_index != menu->rpl_entry_selection_ptr)) ||

View File

@ -97,7 +97,10 @@ void *task_push_core_updater_download(
void task_push_update_installed_cores(const char *path_dir_libretro);
#ifdef HAVE_MENU
bool task_push_pl_thumbnail_download(const char *system, const char *playlist_path);
bool task_push_pl_thumbnail_download(
const char *system, const char *playlist_path,
const char *dir_thumbnails);
bool task_push_pl_entry_thumbnail_download(
const char *system,
playlist_t *playlist,