diff --git a/common/common.c b/common/common.c index 4512d5eb..441f1809 100755 --- a/common/common.c +++ b/common/common.c @@ -3365,10 +3365,10 @@ int load_content(int add_collection, char *sys_dir, char *file_name) { } else { LOG_INFO(mux_module, "Assigned Core: %s", assigned_core); - char *assigned_gov = specify_asset(load_content_governor(sys_dir, NULL, 0, 1, 0), + char *assigned_gov = specify_asset(load_content_governor(sys_dir, content_name, 0, 1, 0), device.CPU.DEFAULT, "Governor"); - char *assigned_con = specify_asset(load_content_control_scheme(sys_dir, NULL, 0, 1, 0), + char *assigned_con = specify_asset(load_content_control_scheme(sys_dir, content_name, 0, 1, 0), "system", "Control Scheme"); char full_file_path[MAX_BUFFER_SIZE]; diff --git a/module/muxshare.c b/module/muxshare.c index 08d62d59..0a3e3029 100755 --- a/module/muxshare.c +++ b/module/muxshare.c @@ -155,53 +155,38 @@ static char *load_content_asset(char *sys_dir, char *pointer, int force, int run char path[MAX_BUFFER_SIZE]; const char *last_subdir = NULL; - if (pointer == NULL) { - if (is_app) { - snprintf(path, sizeof(path), "%s/mux_option.%s", sys_dir, ext); + if (is_app) { + snprintf(path, sizeof(path), "%s/mux_option.%s", sys_dir, ext); - LOG_SUCCESS(mux_module, "Loading Application %s: %s", label, path); + LOG_SUCCESS(mux_module, "Loading Application %s: %s", label, path); - char *txt = read_all_char_from(path); - if (txt) return txt; - - LOG_ERROR(mux_module, "Failed to read application %s", label); - return NULL; - } - - last_subdir = get_last_subdir(sys_dir, '/', 4); - - if (strcasecmp(last_subdir, strip_dir(UNION_ROM_PATH)) == 0) { - snprintf(path, sizeof(path), INFO_COR_PATH "/core.%s", - ext); - } else { - snprintf(path, sizeof(path), INFO_COR_PATH "/%s/%s.%s", - last_subdir, strip_ext(items[current_item_index].name), ext); - - if (file_exist(path) && !force) { - LOG_SUCCESS(mux_module, "Loading Individual %s: %s", label, path); + char *txt = read_all_char_from(path); + if (txt) return txt; - char *txt = read_all_char_from(path); - if (txt) return txt; + LOG_ERROR(mux_module, "Failed to read application %s", label); + return NULL; + } - LOG_ERROR(mux_module, "Failed to read individual %s", label); - } + last_subdir = get_last_subdir(sys_dir, '/', 4); - snprintf(path, sizeof(path), INFO_COR_PATH "/%s/core.%s", - last_subdir, ext); - } + if (strcasecmp(last_subdir, strip_dir(UNION_ROM_PATH)) == 0) { + snprintf(path, sizeof(path), INFO_COR_PATH "/core.%s", + ext); } else { - snprintf(path, sizeof(path), "%s.%s", strip_ext(pointer), ext); + snprintf(path, sizeof(path), INFO_COR_PATH "/%s/%s.%s", + last_subdir, pointer == NULL ? strip_ext(items[current_item_index].name) : pointer, ext); - if (file_exist(path)) { + if (file_exist(path) && !force) { LOG_SUCCESS(mux_module, "Loading Individual %s: %s", label, path); - return read_all_char_from(path); + + char *txt = read_all_char_from(path); + if (txt) return txt; + + LOG_ERROR(mux_module, "Failed to read individual %s", label); } - const char *replaced = str_replace(get_last_subdir(pointer, '/', 6), get_last_dir(pointer), ""); snprintf(path, sizeof(path), INFO_COR_PATH "/%s/core.%s", - replaced, ext); - snprintf(path, sizeof(path), "%s", - str_replace(path, "//", "/")); + last_subdir, ext); } if (file_exist(path) && !force) {