Add 'Scan without Core Match'

This commit is contained in:
twinaphex 2019-05-05 21:54:49 +02:00
parent aaff9d6d55
commit 705851b147
28 changed files with 126 additions and 8 deletions

View File

@ -747,7 +747,9 @@ static const unsigned playlist_show_inline_core_name = PLAYLIST_INLINE_CORE_DISP
static const unsigned playlist_sublabel_runtime_type = PLAYLIST_RUNTIME_PER_CORE;
#endif
static const bool playlist_show_sublabels = false;
static const bool scan_without_core_match = true;
static const bool playlist_show_sublabels = false;
static const bool playlist_fuzzy_archive_match = false;

View File

@ -1571,6 +1571,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("auto_overrides_enable", &settings->bools.auto_overrides_enable, true, default_auto_overrides_enable, false);
SETTING_BOOL("auto_remaps_enable", &settings->bools.auto_remaps_enable, true, default_auto_remaps_enable, false);
SETTING_BOOL("auto_shaders_enable", &settings->bools.auto_shaders_enable, true, default_auto_shaders_enable, false);
SETTING_BOOL("scan_without_core_match", &settings->bools.scan_without_core_match, true, true, false);
SETTING_BOOL("sort_savefiles_enable", &settings->bools.sort_savefiles_enable, true, default_sort_savefiles_enable, false);
SETTING_BOOL("sort_savestates_enable", &settings->bools.sort_savestates_enable, true, default_sort_savestates_enable, false);
SETTING_BOOL("config_save_on_exit", &settings->bools.config_save_on_exit, true, config_save_on_exit, false);

View File

@ -328,6 +328,8 @@ typedef struct settings
bool log_to_file;
bool log_to_file_timestamp;
bool scan_without_core_match;
} bools;
struct

View File

@ -3752,3 +3752,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -4766,3 +4766,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3524,3 +3524,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3653,3 +3653,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -7730,3 +7730,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3412,3 +3412,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -7882,3 +7882,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -8659,3 +8659,7 @@ MSG_HASH(
)
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3637,3 +3637,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -4206,3 +4206,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3505,3 +3505,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -1843,3 +1843,5 @@ MSG_HASH(MENU_ENUM_LABEL_MENU_WIDGETS_ENABLE,
"menu_widgets_enable")
MSG_HASH(MENU_ENUM_LABEL_VIDEO_SHADERS_ENABLE,
"video_shader_enable")
MSG_HASH(MENU_ENUM_LABEL_SCAN_WITHOUT_CORE_MATCH,
"scan_without_core_match")

View File

@ -3406,3 +3406,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3802,3 +3802,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu widgetów")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -8034,3 +8034,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3478,3 +3478,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3681,3 +3681,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -8550,3 +8550,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -8665,3 +8665,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -3568,3 +3568,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE,
"Menu Widgets")
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADERS_ENABLE,
"Video Shaders")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
"Scan without core match")
MSG_HASH(MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH,
"When disabled, content is only added to playlists if you have a core installed that supports its extension. By enabling this, it will add to playlist regardless. This way, you can install the core you need later on after scanning.")

View File

@ -543,6 +543,7 @@ default_sublabel_macro(action_bind_sublabel_menu_rgui_thumbnail_downscaler,
default_sublabel_macro(action_bind_sublabel_menu_rgui_thumbnail_delay, MENU_ENUM_SUBLABEL_MENU_RGUI_THUMBNAIL_DELAY)
default_sublabel_macro(action_bind_sublabel_content_runtime_log, MENU_ENUM_SUBLABEL_CONTENT_RUNTIME_LOG)
default_sublabel_macro(action_bind_sublabel_content_runtime_log_aggregate, MENU_ENUM_SUBLABEL_CONTENT_RUNTIME_LOG_AGGREGATE)
default_sublabel_macro(action_bind_sublabel_scan_without_core_match, MENU_ENUM_SUBLABEL_SCAN_WITHOUT_CORE_MATCH)
default_sublabel_macro(action_bind_sublabel_playlist_sublabel_runtime_type, MENU_ENUM_SUBLABEL_PLAYLIST_SUBLABEL_RUNTIME_TYPE)
default_sublabel_macro(action_bind_sublabel_menu_rgui_internal_upscale_level, MENU_ENUM_SUBLABEL_MENU_RGUI_INTERNAL_UPSCALE_LEVEL)
default_sublabel_macro(action_bind_sublabel_menu_rgui_aspect_ratio, MENU_ENUM_SUBLABEL_MENU_RGUI_ASPECT_RATIO)
@ -2475,6 +2476,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_runtime_log);
break;
case MENU_ENUM_LABEL_SCAN_WITHOUT_CORE_MATCH:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_scan_without_core_match);
break;
case MENU_ENUM_LABEL_CONTENT_RUNTIME_LOG_AGGREGATE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_content_runtime_log_aggregate);
break;

View File

@ -5479,6 +5479,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{MENU_ENUM_LABEL_PLAYLIST_SHOW_SUBLABELS, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_PLAYLIST_SUBLABEL_RUNTIME_TYPE, PARSE_ONLY_UINT},
{MENU_ENUM_LABEL_PLAYLIST_FUZZY_ARCHIVE_MATCH, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_SCAN_WITHOUT_CORE_MATCH, PARSE_ONLY_BOOL},
};
for (i = 0; i < ARRAY_SIZE(build_list); i++)

View File

@ -7562,6 +7562,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
CONFIG_BOOL(
list, list_info,
&settings->bools.scan_without_core_match,
MENU_ENUM_LABEL_SCAN_WITHOUT_CORE_MATCH,
MENU_ENUM_LABEL_VALUE_SCAN_WITHOUT_CORE_MATCH,
scan_without_core_match,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE);
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
}

View File

@ -435,6 +435,7 @@ enum msg_hash_enums
MSG_RUNAHEAD_FAILED_TO_CREATE_SECONDARY_INSTANCE,
MSG_MISSING_ASSETS,
MENU_LABEL(SCAN_WITHOUT_CORE_MATCH),
MENU_LABEL(STREAMING_TITLE),
MENU_LABEL(STREAMING_MODE),
MENU_LABEL(VIDEO_RECORD_QUALITY),

View File

@ -36,6 +36,7 @@
#include "../msg_hash.h"
#include "../playlist.h"
#ifdef RARCH_INTERNAL
#include "../configuration.h"
#include "../retroarch.h"
#endif
#include "../verbosity.h"
@ -61,6 +62,7 @@ typedef struct db_handle
{
bool is_directory;
bool scan_started;
bool scan_without_core_match;
bool show_hidden_files;
unsigned status;
char *playlist_directory;
@ -940,13 +942,19 @@ static int task_database_iterate_crc_lookup(
query[0] = '\0';
/* don't scan files that can't be in this database */
if (!(path_contains_compressed_file(name) &&
core_info_database_match_archive_member(
db_state->list->elems[db_state->list_index].data)) &&
!core_info_database_supports_content_path(
db_state->list->elems[db_state->list_index].data, name))
return database_info_list_iterate_next(db_state);
if (!_db->scan_without_core_match)
{
/* don't scan files that can't be in this database.
*
* Could be because of:
* A matching core missing */
if (!(path_contains_compressed_file(name) &&
core_info_database_match_archive_member(
db_state->list->elems[db_state->list_index].data)) &&
!core_info_database_supports_content_path(
db_state->list->elems[db_state->list_index].data, name))
return database_info_list_iterate_next(db_state);
}
snprintf(query, sizeof(query),
"{crc:or(b\"%08X\",b\"%08X\")}",
@ -1359,6 +1367,9 @@ bool task_push_dbscan(
retro_task_callback_t cb)
{
retro_task_t *t = task_init();
#ifdef RARCH_INTERNAL
settings_t *settings = config_get_ptr();
#endif
db_handle_t *db = (db_handle_t*)calloc(1, sizeof(db_handle_t));
if (!t || !db)
@ -1370,6 +1381,9 @@ bool task_push_dbscan(
t->title = strdup(msg_hash_to_str(MSG_PREPARING_FOR_CONTENT_SCAN));
t->alternative_look = true;
#ifdef RARCH_INTERNAL
db->scan_without_core_match = settings->bools.scan_without_core_match;
#endif
db->show_hidden_files = db_dir_show_hidden_files;
db->is_directory = directory;
db->playlist_directory = NULL;