mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 12:41:00 +00:00
remove dependence on configuration.h inside task_database.c
This commit is contained in:
parent
039064d0f1
commit
a3f5590f41
@ -54,6 +54,7 @@ int action_scan_file(const char *path,
|
|||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = NULL;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
fullpath[0] = '\0';
|
fullpath[0] = '\0';
|
||||||
|
|
||||||
@ -64,7 +65,10 @@ int action_scan_file(const char *path,
|
|||||||
|
|
||||||
fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath));
|
fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath));
|
||||||
|
|
||||||
task_push_dbscan(fullpath, false, handle_dbscan_finished);
|
task_push_dbscan(
|
||||||
|
settings->directory.playlist,
|
||||||
|
settings->path.content_database,
|
||||||
|
fullpath, false, handle_dbscan_finished);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -77,6 +81,7 @@ int action_scan_directory(const char *path,
|
|||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = NULL;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
fullpath[0] = '\0';
|
fullpath[0] = '\0';
|
||||||
|
|
||||||
@ -90,7 +95,10 @@ int action_scan_directory(const char *path,
|
|||||||
if (path)
|
if (path)
|
||||||
fill_pathname_join(fullpath, fullpath, path, sizeof(fullpath));
|
fill_pathname_join(fullpath, fullpath, path, sizeof(fullpath));
|
||||||
|
|
||||||
task_push_dbscan(fullpath, true, handle_dbscan_finished);
|
task_push_dbscan(
|
||||||
|
settings->directory.playlist,
|
||||||
|
settings->path.content_database,
|
||||||
|
fullpath, true, handle_dbscan_finished);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#include "../database_info.h"
|
#include "../database_info.h"
|
||||||
|
|
||||||
#include "../configuration.h"
|
|
||||||
#include "../file_path_special.h"
|
#include "../file_path_special.h"
|
||||||
#include "../list_special.h"
|
#include "../list_special.h"
|
||||||
#include "../msg_hash.h"
|
#include "../msg_hash.h"
|
||||||
@ -700,10 +699,12 @@ task_finished:
|
|||||||
free(dbinfo);
|
free(dbinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool task_push_dbscan(const char *fullpath,
|
bool task_push_dbscan(
|
||||||
|
const char *playlist_directory,
|
||||||
|
const char *content_database,
|
||||||
|
const char *fullpath,
|
||||||
bool directory, retro_task_callback_t cb)
|
bool directory, retro_task_callback_t cb)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
|
retro_task_t *t = (retro_task_t*)calloc(1, sizeof(*t));
|
||||||
db_handle_t *db = (db_handle_t*)calloc(1, sizeof(db_handle_t));
|
db_handle_t *db = (db_handle_t*)calloc(1, sizeof(db_handle_t));
|
||||||
|
|
||||||
@ -714,11 +715,9 @@ bool task_push_dbscan(const char *fullpath,
|
|||||||
t->state = db;
|
t->state = db;
|
||||||
t->callback = cb;
|
t->callback = cb;
|
||||||
|
|
||||||
strlcpy(db->playlist_directory,
|
strlcpy(db->playlist_directory, playlist_directory,
|
||||||
settings->directory.playlist,
|
|
||||||
sizeof(db->playlist_directory));
|
sizeof(db->playlist_directory));
|
||||||
strlcpy(db->content_database_path,
|
strlcpy(db->content_database_path, content_database,
|
||||||
settings->path.content_database,
|
|
||||||
sizeof(db->content_database_path));
|
sizeof(db->content_database_path));
|
||||||
|
|
||||||
if (directory)
|
if (directory)
|
||||||
|
@ -104,7 +104,10 @@ bool task_push_image_load(const char *fullpath,
|
|||||||
retro_task_callback_t cb, void *userdata);
|
retro_task_callback_t cb, void *userdata);
|
||||||
|
|
||||||
#ifdef HAVE_LIBRETRODB
|
#ifdef HAVE_LIBRETRODB
|
||||||
bool task_push_dbscan(const char *fullpath,
|
bool task_push_dbscan(
|
||||||
|
const char *playlist_directory,
|
||||||
|
const char *content_database,
|
||||||
|
const char *fullpath,
|
||||||
bool directory, retro_task_callback_t cb);
|
bool directory, retro_task_callback_t cb);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user