Skip to content

Commit 7eea423

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 7184a1c commit 7eea423

16 files changed

+1358
-736
lines changed

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
@@ -8320,7 +8320,7 @@ MSG_HASH(
83208320
)
83218321
MSG_HASH(
83228322
MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_REFRESH_PLAYLIST,
8323-
"Add new content and remove invalid entries by repeating the 'Manual Scan' operation last used to create or edit the playlist."
8323+
"Add new content and remove invalid entries by repeating the content scan operation last used to create or edit the playlist."
83248324
)
83258325
MSG_HASH(
83268326
MENU_ENUM_LABEL_VALUE_DELETE_PLAYLIST,
@@ -8917,11 +8917,11 @@ MSG_HASH(
89178917
)
89188918
MSG_HASH(
89198919
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST,
8920-
"Manual Scan"
8920+
"Content Scan"
89218921
)
89228922
MSG_HASH(
89238923
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_LIST,
8924-
"Configurable scan based on content file names. Does not require content to match the database."
8924+
"Configurable scan based on content file names and/or database match."
89258925
)
89268926
MSG_HASH(
89278927
MENU_ENUM_LABEL_VALUE_SCAN_ENTRY,
@@ -8987,31 +8987,31 @@ MSG_HASH(
89878987
"Add to Mixer and Play"
89888988
)
89898989

8990-
/* Import Content > Manual Scan */
8990+
/* Import Content > Content Scan */
89918991

89928992
MSG_HASH(
89938993
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_DIR,
8994-
"Content Directory"
8994+
"Content Location"
89958995
)
89968996
MSG_HASH(
89978997
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_DIR,
8998-
"Select a directory to scan for content."
8998+
"Select a directory (or file) to scan for content."
89998999
)
90009000
MSG_HASH(
90019001
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME,
9002-
"System Name"
9002+
"Target Playlist"
90039003
)
90049004
MSG_HASH(
90059005
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME,
9006-
"Specify a 'system name' with which to associate scanned content. Used to name to the generated playlist file and to identify playlist thumbnails."
9006+
"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."
90079007
)
90089008
MSG_HASH(
90099009
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME_CUSTOM,
9010-
"Custom System Name"
9010+
"Custom Playlist Name"
90119011
)
90129012
MSG_HASH(
90139013
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME_CUSTOM,
9014-
"Manually specify a 'system name' for scanned content. Only used when 'System Name' is set to '<Custom>'."
9014+
"Custom playlist name for scanned content."
90159015
)
90169016
MSG_HASH(
90179017
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_CORE_NAME,

0 commit comments

Comments
 (0)