Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions intl/msg_hash_lbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3758,6 +3758,18 @@ MSG_HASH(
MENU_ENUM_LABEL_SCAN_FILE,
"scan_file"
)
MSG_HASH(
MENU_ENUM_LABEL_SCAN_TARGET_PLAYLIST,
"scan_target_playlist"
)
MSG_HASH(
MENU_ENUM_LABEL_SCAN_SINGLE_FILE,
"scan_single_file"
)
MSG_HASH(
MENU_ENUM_LABEL_SCAN_OMIT_DB_REF,
"scan_omit_db_ref"
)
MSG_HASH(
MENU_ENUM_LABEL_NETPLAY_SHOW_ONLY_CONNECTABLE,
"netplay_show_only_connectable"
Expand Down Expand Up @@ -6562,6 +6574,30 @@ MSG_HASH(
MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_DIR,
"manual_content_scan_dir"
)
MSG_HASH(
MENU_ENUM_LABEL_SCAN_METHOD,
"scan_method"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SCAN_METHOD,
"deferred_dropdown_box_list_scan_method"
)
MSG_HASH(
MENU_ENUM_LABEL_SCAN_USE_DB,
"scan_use_db"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SCAN_USE_DB,
"deferred_dropdown_box_list_scan_use_db"
)
MSG_HASH(
MENU_ENUM_LABEL_SCAN_DB_SELECT,
"scan_db_select"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SCAN_DB_SELECT,
"deferred_dropdown_box_list_scan_db_select"
)
MSG_HASH(
MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_SYSTEM_NAME,
"manual_content_scan_system_name"
Expand Down
96 changes: 96 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -8886,6 +8886,54 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_ENTRY,
"Scan"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_METHOD,
"Scan Method"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_SCAN_METHOD,
"Automatic or custom with detailed options."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB,
"Database Check"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_SCAN_USE_DB,
"Strict will only add items that match a database entry, Loose will add also files with correct extension but no CRC/serial match, Custom DAT checks against a user provided XML file instead of databases, None ignores databases and only uses file extensions."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_DB_SELECT,
"Database To Match"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_SCAN_DB_SELECT,
"Matching can be restricted to one specific database, or to the very first database that matches, to speed up scanning."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_TARGET_PLAYLIST,
"Playlist To Update"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_SCAN_TARGET_PLAYLIST,
"Results are added to this playlist. In case of Auto - Any, multiple system playlists may be updated. Custom without database reference will not link the entries to any database in the playlist."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_SINGLE_FILE,
"Scan Single File"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_SCAN_SINGLE_FILE,
"Scans only one file instead of a directory. Re-select content location after changing this entry."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_OMIT_DB_REF,
"Skip Database References From Playlist"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_SCAN_OMIT_DB_REF,
"In case of custom playlist name, always use the playlist name for thumbnail search, even if there was a database match."
)

/* Import Content > Scan File */

Expand Down Expand Up @@ -11528,6 +11576,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME_USE_CONTENT_DIR,
"<Content Directory>"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME_USE_AUTO,
"<Automatic>"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_SYSTEM_NAME_USE_CUSTOM,
"<Custom>"
Expand All @@ -11536,6 +11588,50 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_CORE_NAME_DETECT,
"<Unspecified>"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_METHOD_AUTO,
"Fully Automatic"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_METHOD_CUSTOM,
"Custom"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_STRICT,
"Strict"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_LOOSE,
"Loose"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_CUSTOM_DAT,
"Custom DAT (Strict)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_CUSTOM_DAT_LOOSE,
"Custom DAT (Loose)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_NONE,
"None"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_DB_SELECT_AUTO_ANY,
"<Automatic/Any>"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_DB_SELECT_AUTO_FIRST,
"<Automatic/First match>"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_TARGET_PLAYLIST_AUTO_ANY,
"<Automatic/System name>"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCAN_TARGET_PLAYLIST_CUSTOM,
"<Custom>"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_LEFT_ANALOG,
"Left Analog"
Expand Down
185 changes: 185 additions & 0 deletions manual_content_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ char *manual_content_scan_get_content_dir_ptr(void)
return scan_settings.content_dir;
}

unsigned manual_content_scan_get_scan_method_enum(void)
{
return 0;
}

unsigned manual_content_scan_get_scan_use_db_enum(void)
{
return 0;
}

/* Returns a pointer to the internal
* 'system_name_custom' string */
char *manual_content_scan_get_system_name_custom_ptr(void)
Expand Down Expand Up @@ -157,6 +167,16 @@ bool *manual_content_scan_get_search_archives_ptr(void)
return &scan_settings.search_archives;
}

bool *manual_content_scan_get_scan_single_file_ptr(void)
{
return NULL;
}

bool *manual_content_scan_get_omit_db_ref_ptr(void)
{
return NULL;
}

/* Returns a pointer to the internal
* 'filter_dat_content' bool */
bool *manual_content_scan_get_filter_dat_content_ptr(void)
Expand Down Expand Up @@ -334,6 +354,25 @@ bool manual_content_scan_set_menu_content_dir(const char *content_dir)
return false;
}

bool manual_content_scan_set_menu_scan_method(
enum manual_content_scan_method method)
{
return true;
}

bool manual_content_scan_set_menu_scan_use_db(
enum manual_content_scan_db_usage usage)
{
return true;
}

bool manual_content_scan_set_menu_scan_db_select(
enum manual_content_scan_db_selection select,
const char *db_name)
{
return false;
}

/* Sets system name for the next manual scan
* operation.
* Returns true if system name is valid.
Expand Down Expand Up @@ -696,6 +735,26 @@ bool manual_content_scan_get_menu_content_dir(const char **content_dir)
return true;
}

bool manual_content_scan_get_menu_scan_method(const char **scan_method)
{
return false;
}

bool manual_content_scan_get_menu_scan_use_db(const char **scan_use_db)
{
return false;
}

unsigned manual_content_scan_get_scan_db_select_enum(void)
{
return 0;
}

bool manual_content_scan_get_menu_scan_db_select(const char **scan_db_select)
{
return false;
}

/* Fetches system name for the next manual scan operation.
* Returns true if system name is valid.
* NOTE: This corresponds to the 'System Name' value
Expand Down Expand Up @@ -730,6 +789,10 @@ bool manual_content_scan_get_menu_system_name(const char **system_name)
return false;
}

unsigned manual_content_scan_get_menu_system_name_type(void)
{
return 0;
}
/* Fetches core name for the next manual scan operation.
* Returns true if core name is valid. */
bool manual_content_scan_get_menu_core_name(const char **core_name)
Expand Down Expand Up @@ -759,6 +822,128 @@ bool manual_content_scan_get_menu_core_name(const char **core_name)

/* Menu utility functions */


struct string_list *manual_content_scan_get_menu_scan_method_list(void)
{
return NULL;

}

struct string_list *manual_content_scan_get_menu_scan_use_db_list(void)
{
union string_list_elem_attr attr;
struct string_list *name_list = string_list_new();

/* Sanity check */
if (!name_list)
return NULL;

attr.i = 0;

if (!string_list_append(name_list, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_STRICT), attr))
goto error;

if (!string_list_append(name_list, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_LOOSE), attr))
goto error;

if (!string_list_append(name_list, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_CUSTOM_DAT), attr))
goto error;

if (!string_list_append(name_list, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_CUSTOM_DAT_LOOSE), attr))
goto error;

if (!string_list_append(name_list, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SCAN_USE_DB_NONE), attr))
goto error;

return name_list;

error:
if (name_list)
string_list_free(name_list);
return NULL;

}


struct string_list *manual_content_scan_get_menu_scan_db_select_list(
const char *path_content_database, bool show_hidden_files)
{
union string_list_elem_attr attr;
struct string_list *name_list = string_list_new();

/* Sanity check */
if (!name_list)
return NULL;

attr.i = 0;

/* Add 'use content directory' entry */
if (!string_list_append(name_list, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SCAN_DB_SELECT_AUTO_ANY), attr))
goto error;

/* Add 'use custom' entry */
if (!string_list_append(name_list, msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SCAN_DB_SELECT_AUTO_FIRST), attr))
goto error;

#ifdef HAVE_LIBRETRODB
/* If platform has database support, get names
* of all installed database files */
{
/* Note: dir_list_new_special() is well behaved - the
* returned string list will only include database
* files (i.e. don't have to check for directories,
* or verify file extensions) */
struct string_list *rdb_list = dir_list_new_special(
path_content_database,
DIR_LIST_DATABASES, NULL, show_hidden_files);

if (rdb_list && rdb_list->size)
{
unsigned i;

/* Ensure database list is in alphabetical order */
dir_list_sort(rdb_list, true);

/* Loop over database files */
for (i = 0; i < rdb_list->size; i++)
{
char rdb_name[NAME_MAX_LENGTH];
const char *rdb_path = rdb_list->elems[i].data;
/* Sanity check */
if (string_is_empty(rdb_path))
continue;
fill_pathname(rdb_name, path_basename(rdb_path), "",
sizeof(rdb_name));
if (string_is_empty(rdb_name))
continue;
/* Add database name to list */
if (!string_list_append(name_list, rdb_name, attr))
goto error;
}
}

/* Clean up */
string_list_free(rdb_list);
}

#endif

return name_list;

error:
if (name_list)
string_list_free(name_list);
return NULL;
}


/* Creates a list of all possible 'system name' menu
* strings, for use in 'menu_displaylist' drop-down
* lists and 'menu_cbs_left/right'
Expand Down
Loading
Loading