From 1a1418ccfbafd4f185dd5ce6218d6a031d89dcca Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 21 May 2019 22:38:50 +0200 Subject: [PATCH] (Samples) tasks/database - should work again --- playlist.c | 14 +++++++++++--- samples/tasks/database/Makefile | 2 ++ tasks/task_database.c | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/playlist.c b/playlist.c index 5c24d62f2a..a1eeebfe3a 100644 --- a/playlist.c +++ b/playlist.c @@ -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); diff --git a/samples/tasks/database/Makefile b/samples/tasks/database/Makefile index d87b5d33ae..e4b9f4216f 100644 --- a/samples/tasks/database/Makefile +++ b/samples/tasks/database/Makefile @@ -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 \ diff --git a/tasks/task_database.c b/tasks/task_database.c index 3b3a053503..c773bd81a9 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -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;