mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 12:41:00 +00:00
skip scanning of compressed files within archives if the core attached to this database supports archive files themselves
This commit is contained in:
parent
2fe10a0a23
commit
88c8c49ef8
52
core_info.c
52
core_info.c
@ -691,15 +691,37 @@ size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
|
||||
bool core_info_unsupported_content_path(const char *path)
|
||||
{
|
||||
size_t i;
|
||||
const char *delim;
|
||||
const char *archive_path = NULL;
|
||||
|
||||
delim = path_get_archive_delim(path);
|
||||
|
||||
if (delim)
|
||||
archive_path = delim - 1;
|
||||
|
||||
if (!core_info_curr_list)
|
||||
return false;
|
||||
|
||||
/* if the path contains a compressed file and the core supports archives,
|
||||
* we don't want to look at this file */
|
||||
if (archive_path)
|
||||
{
|
||||
for (i = 0; i < core_info_curr_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_curr_list->list[i];
|
||||
|
||||
if (string_list_find_elem(info->supported_extensions_list, "zip") ||
|
||||
string_list_find_elem(info->supported_extensions_list, "7z"))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < core_info_curr_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_curr_list->list[i];
|
||||
bool path_in_ext_list = string_list_find_elem(info->supported_extensions_list, path_get_extension(path));
|
||||
|
||||
if (string_list_find_elem(info->supported_extensions_list, path_get_extension(path)))
|
||||
if (path_in_ext_list)
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -709,7 +731,9 @@ bool core_info_unsupported_content_path(const char *path)
|
||||
bool core_info_database_supports_content_path(const char *database_path, const char *path)
|
||||
{
|
||||
size_t i;
|
||||
char *database = NULL;
|
||||
char *database;
|
||||
const char *delim;
|
||||
const char *archive_path = NULL;
|
||||
|
||||
if (!core_info_curr_list)
|
||||
return false;
|
||||
@ -718,16 +742,38 @@ bool core_info_database_supports_content_path(const char *database_path, const c
|
||||
|
||||
path_remove_extension(database);
|
||||
|
||||
delim = path_get_archive_delim(path);
|
||||
|
||||
if (delim)
|
||||
archive_path = delim - 1;
|
||||
|
||||
/* if the path contains a compressed file and the core supports archives,
|
||||
* we don't want to look at this file */
|
||||
if (archive_path)
|
||||
{
|
||||
for (i = 0; i < core_info_curr_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_curr_list->list[i];
|
||||
|
||||
if (string_list_find_elem(info->supported_extensions_list, "zip") ||
|
||||
string_list_find_elem(info->supported_extensions_list, "7z"))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < core_info_curr_list->count; i++)
|
||||
{
|
||||
const core_info_t *info = &core_info_curr_list->list[i];
|
||||
bool path_in_ext_list = string_list_find_elem(info->supported_extensions_list, path_get_extension(path));
|
||||
|
||||
if (string_list_find_elem(info->supported_extensions_list, path_get_extension(path)))
|
||||
if (path_in_ext_list)
|
||||
{
|
||||
if (string_list_find_elem(info->databases_list, database))
|
||||
{
|
||||
free(database);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(database);
|
||||
|
@ -335,12 +335,17 @@ static int task_database_iterate_crc_lookup(
|
||||
|
||||
if (db_state->entry_index == 0)
|
||||
{
|
||||
bool db_supports_content;
|
||||
bool unsupported_content;
|
||||
char query[50];
|
||||
|
||||
query[0] = '\0';
|
||||
|
||||
if (!core_info_database_supports_content_path(db_state->list->elems[db_state->list_index].data, name) &&
|
||||
!core_info_unsupported_content_path(name))
|
||||
db_supports_content = core_info_database_supports_content_path(db_state->list->elems[db_state->list_index].data, name);
|
||||
unsupported_content = core_info_unsupported_content_path(name);
|
||||
|
||||
/* don't scan files that can't be in this database */
|
||||
if(!db_supports_content && !unsupported_content)
|
||||
return database_info_list_iterate_next(db_state);
|
||||
|
||||
snprintf(query, sizeof(query),
|
||||
|
Loading…
x
Reference in New Issue
Block a user