Skip to content

Commit 87c76ee

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 e4221d4 commit 87c76ee

16 files changed

Lines changed: 1362 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
@@ -7993,7 +7993,7 @@ MSG_HASH(
79937993
)
79947994
MSG_HASH(
79957995
MENU_ENUM_SUBLABEL_PLAYLIST_MANAGER_REFRESH_PLAYLIST,
7996-
"Add new content and remove invalid entries by repeating the 'Manual Scan' operation last used to create or edit the playlist."
7996+
"Add new content and remove invalid entries by repeating the content scan operation last used to create or edit the playlist."
79977997
)
79987998
MSG_HASH(
79997999
MENU_ENUM_LABEL_VALUE_DELETE_PLAYLIST,
@@ -8590,11 +8590,11 @@ MSG_HASH(
85908590
)
85918591
MSG_HASH(
85928592
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_LIST,
8593-
"Manual Scan"
8593+
"Content Scan"
85948594
)
85958595
MSG_HASH(
85968596
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_LIST,
8597-
"Configurable scan based on content file names. Does not require content to match the database."
8597+
"Configurable scan based on content file names and/or database match."
85988598
)
85998599
MSG_HASH(
86008600
MENU_ENUM_LABEL_VALUE_SCAN_ENTRY,
@@ -8660,31 +8660,31 @@ MSG_HASH(
86608660
"Add to Mixer and Play"
86618661
)
86628662

8663-
/* Import Content > Manual Scan */
8663+
/* Import Content > Content Scan */
86648664

86658665
MSG_HASH(
86668666
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_DIR,
8667-
"Content Directory"
8667+
"Content Location"
86688668
)
86698669
MSG_HASH(
86708670
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_DIR,
8671-
"Select a directory to scan for content."
8671+
"Select a directory (or file) to scan for content."
86728672
)
86738673
MSG_HASH(
86748674
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME,
8675-
"System Name"
8675+
"Target Playlist"
86768676
)
86778677
MSG_HASH(
86788678
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME,
8679-
"Specify a 'system name' with which to associate scanned content. Used to name to the generated playlist file and to identify playlist thumbnails."
8679+
"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."
86808680
)
86818681
MSG_HASH(
86828682
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME_CUSTOM,
8683-
"Custom System Name"
8683+
"Custom Playlist Name"
86848684
)
86858685
MSG_HASH(
86868686
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME_CUSTOM,
8687-
"Manually specify a 'system name' for scanned content. Only used when 'System Name' is set to '<Custom>'."
8687+
"Custom playlist name for scanned content."
86888688
)
86898689
MSG_HASH(
86908690
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_CORE_NAME,

0 commit comments

Comments
 (0)