(Samples) tasks/database - should work again

This commit is contained in:
twinaphex 2019-05-21 22:38:50 +02:00
parent 9220248c32
commit 1a1418ccfb
3 changed files with 15 additions and 5 deletions

View File

@ -85,15 +85,17 @@ typedef int (playlist_sort_fun_t)(
**/
static bool playlist_path_equal(const char *real_path, const char *entry_path)
{
settings_t *settings = config_get_ptr();
bool real_path_is_compressed;
bool entry_real_path_is_compressed;
char entry_real_path[PATH_MAX_LENGTH];
#ifdef RARCH_INTERNAL
settings_t *settings = config_get_ptr();
#endif
entry_real_path[0] = '\0';
/* Sanity check */
if (string_is_empty(real_path) || string_is_empty(entry_path) || !settings)
if (string_is_empty(real_path) || string_is_empty(entry_path))
return false;
/* Get entry 'real' path */
@ -113,9 +115,11 @@ static bool playlist_path_equal(const char *real_path, const char *entry_path)
return true;
#endif
#ifdef RARCH_INTERNAL
/* If fuzzy matching is disabled, we can give up now */
if (!settings->bools.playlist_fuzzy_archive_match)
if (!settings || !settings->bools.playlist_fuzzy_archive_match)
return false;
#endif
/* If we reach this point, we have to work
* harder...
@ -1114,7 +1118,9 @@ void playlist_write_file(playlist_t *playlist)
{
size_t i;
RFILE *file = NULL;
#ifdef RARCH_INTERNAL
settings_t *settings = config_get_ptr();
#endif
if (!playlist || !playlist->modified)
return;
@ -1128,6 +1134,7 @@ void playlist_write_file(playlist_t *playlist)
return;
}
#ifdef RARCH_INTERNAL
if (settings->bools.playlist_use_old_format)
{
for (i = 0; i < playlist->size; i++)
@ -1141,6 +1148,7 @@ void playlist_write_file(playlist_t *playlist)
);
}
else
#endif
{
JSONContext context = {0};
context.writer = JSON_Writer_Create(NULL);

View File

@ -90,6 +90,8 @@ SOURCES_C := \
$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax.c \
$(LIBRETRO_COMM_DIR)/formats/json/jsonsax_full.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/queues/task_queue.c \

View File

@ -38,9 +38,9 @@
#ifdef RARCH_INTERNAL
#include "../configuration.h"
#include "../retroarch.h"
#include "../ui/ui_companion_driver.h"
#endif
#include "../verbosity.h"
#include "../ui/ui_companion_driver.h"
#ifndef COLLECTION_SIZE
#define COLLECTION_SIZE 99999
#endif
@ -1314,10 +1314,10 @@ static void task_database_handler(retro_task_t *task)
task_free_title(task);
task_set_title(task, strdup(msg));
task_set_progress(task, 100);
ui_companion_driver_notify_refresh();
#else
fprintf(stderr, "msg: %s\n", msg);
#endif
ui_companion_driver_notify_refresh();
goto task_finished;
}
break;