Skip to content

Commit c9cccf4

Browse files
committed
Merge of manual and autoscan
Scanning options are unified for a single operation, which can be customized to cover previous autoscan, manual scan, DAT scan, and a lot of combinations in-between. More details in the pull request.
1 parent 5616e49 commit c9cccf4

16 files changed

Lines changed: 1358 additions & 736 deletions

Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ OBJ += \
434434
$(LIBRETRO_COMM_DIR)/playlists/label_sanitization.o \
435435
$(LIBRETRO_COMM_DIR)/time/rtime.o \
436436
manual_content_scan.o \
437+
tasks/task_database.o \
437438
disk_control_interface.o
438439

439440
ifeq ($(HAVE_CONFIGFILE), 1)
@@ -583,7 +584,6 @@ ifeq ($(HAVE_LIBRETRODB), 1)
583584
libretro-db/rmsgpack.o \
584585
libretro-db/rmsgpack_dom.o \
585586
database_info.o \
586-
tasks/task_database.o \
587587
tasks/task_database_cue.o
588588

589589
ifeq ($(HAVE_MENU), 1)

database_info.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "core_info.h"
3131
#include "database_info.h"
32+
#include "manual_content_scan.h"
3233

3334
int database_info_build_query_enum(char *s, size_t len,
3435
enum database_query_type type,
@@ -797,8 +798,9 @@ static int dir_entry_compare(const void *left, const void *right)
797798
}
798799

799800
database_info_handle_t *database_info_dir_init(const char *dir,
800-
enum database_type type, retro_task_t *task,
801-
bool show_hidden_files)
801+
enum database_type type, char *file_exts,
802+
bool show_hidden_files, bool recursive, bool include_archive,
803+
struct string_list **content_list)
802804
{
803805
core_info_list_t *core_info_list = NULL;
804806
struct string_list *list = NULL;
@@ -808,11 +810,13 @@ database_info_handle_t *database_info_dir_init(const char *dir,
808810
if (!db)
809811
return NULL;
810812

811-
core_info_get_list(&core_info_list);
813+
/* File list will include all supported files, unless extension list is given */
814+
if (string_is_empty(file_exts))
815+
core_info_get_list(&core_info_list);
812816

813-
if (!(list = dir_list_new(dir, core_info_list ? core_info_list->all_ext : NULL,
817+
if (!(list = dir_list_new(dir, core_info_list ? core_info_list->all_ext : file_exts,
814818
false, show_hidden_files,
815-
false, true)))
819+
include_archive, recursive)))
816820
{
817821
free(db);
818822
return NULL;
@@ -823,14 +827,13 @@ database_info_handle_t *database_info_dir_init(const char *dir,
823827

824828
db->status = DATABASE_STATUS_ITERATE;
825829
db->type = type;
826-
db->list_ptr = 0;
827-
db->list = list;
830+
*content_list = list;
828831

829832
return db;
830833
}
831834

832835
database_info_handle_t *database_info_file_init(const char *path,
833-
enum database_type type, retro_task_t *task)
836+
enum database_type type, retro_task_t *task, struct string_list **content_list)
834837
{
835838
union string_list_elem_attr attr;
836839
struct string_list *list = NULL;
@@ -851,16 +854,15 @@ database_info_handle_t *database_info_file_init(const char *path,
851854

852855
db->status = DATABASE_STATUS_ITERATE;
853856
db->type = type;
854-
db->list_ptr = 0;
855-
db->list = list;
857+
*content_list = list;
856858

857859
return db;
858860
}
859861

860862
void database_info_free(database_info_handle_t *db)
861863
{
862-
if (db)
863-
string_list_free(db->list);
864+
/* if (db)
865+
string_list_free(db->list);*/
864866
}
865867

866868
database_info_list_t *database_info_list_new(

database_info.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ enum database_query_type
7575

7676
typedef struct
7777
{
78-
struct string_list *list;
79-
size_t list_ptr;
8078
enum database_status status;
8179
enum database_type type;
8280
} database_info_handle_t;
@@ -145,11 +143,12 @@ database_info_list_t *database_info_list_new(const char *rdb_path,
145143
void database_info_list_free(database_info_list_t *list);
146144

147145
database_info_handle_t *database_info_dir_init(const char *dir,
148-
enum database_type type, retro_task_t *task,
149-
bool show_hidden_files);
146+
enum database_type type, char* file_exts,
147+
bool show_hidden_files, bool recursive, bool include_archive,
148+
struct string_list **content_list);
150149

151150
database_info_handle_t *database_info_file_init(const char *path,
152-
enum database_type type, retro_task_t *task);
151+
enum database_type type, retro_task_t *task, struct string_list **content_list);
153152

154153
void database_info_free(database_info_handle_t *handle);
155154

intl/msg_hash_us.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8279,7 +8279,7 @@ MSG_HASH(
82798279
)
82808280
MSG_HASH(
82818281
MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_REFRESH_PLAYLIST,
8282-
"Add new content and remove invalid entries by repeating the 'Manual Scan' operation last used to create or edit the playlist."
8282+
"Add new content and remove invalid entries by repeating the content scan operation last used to create or edit the playlist."
82838283
)
82848284
MSG_HASH(
82858285
MENU_ENUM_LABEL_VALUE_DELETE_PLAYLIST,
@@ -8876,11 +8876,11 @@ MSG_HASH(
88768876
)
88778877
MSG_HASH(
88788878
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST,
8879-
"Manual Scan"
8879+
"Content Scan"
88808880
)
88818881
MSG_HASH(
88828882
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_LIST,
8883-
"Configurable scan based on content file names. Does not require content to match the database."
8883+
"Configurable scan based on content file names and/or database match."
88848884
)
88858885
MSG_HASH(
88868886
MENU_ENUM_LABEL_VALUE_SCAN_ENTRY,
@@ -8946,31 +8946,31 @@ MSG_HASH(
89468946
"Add to Mixer and Play"
89478947
)
89488948

8949-
/* Import Content > Manual Scan */
8949+
/* Import Content > Content Scan */
89508950

89518951
MSG_HASH(
89528952
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_DIR,
8953-
"Content Directory"
8953+
"Content Location"
89548954
)
89558955
MSG_HASH(
89568956
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_DIR,
8957-
"Select a directory to scan for content."
8957+
"Select a directory (or file) to scan for content."
89588958
)
89598959
MSG_HASH(
89608960
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME,
8961-
"System Name"
8961+
"Target Playlist"
89628962
)
89638963
MSG_HASH(
89648964
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME,
8965-
"Specify a 'system name' with which to associate scanned content. Used to name to the generated playlist file and to identify playlist thumbnails."
8965+
"Name of the generated playlist file, also used to identify playlist thumbnails. Automatic setting will use the same name as the matching database or content directory."
89668966
)
89678967
MSG_HASH(
89688968
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME_CUSTOM,
8969-
"Custom System Name"
8969+
"Custom Playlist Name"
89708970
)
89718971
MSG_HASH(
89728972
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME_CUSTOM,
8973-
"Manually specify a 'system name' for scanned content. Only used when 'System Name' is set to '<Custom>'."
8973+
"Custom playlist name for scanned content."
89748974
)
89758975
MSG_HASH(
89768976
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_CORE_NAME,

0 commit comments

Comments
 (0)