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
4 changes: 2 additions & 2 deletions common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
57 changes: 21 additions & 36 deletions module/muxshare.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down