when a user is scanning in roms set a cloneof setting, if the user has the parent do not show the clone

This commit is contained in:
thelamer 2021-11-11 15:40:40 -08:00
parent 26053d4d34
commit aec7791e96
4 changed files with 3066 additions and 981 deletions

View File

@ -205,6 +205,12 @@ async function rendermenu(data, active_item) {
$('#menu').data('root', root);
var parent = data.parent;
var items = data.items;
for await (var name of Object.keys(items)) {
var item = data.items[name];
if ((item.hasOwnProperty('cloneof')) && (items.hasOwnProperty(item.cloneof))) {
delete items[name];
}
};
var items_length = Object.keys(items).length - 1;
// Determine counts and style based on menu items
var display_items = data.display_items;

View File

@ -237,6 +237,10 @@ io.on('connection', async function (socket) {
};
// Add roms to config file
async function addToConfig(dir, render) {
if (dir == 'arcade') {
var metaData = await fsw.readFile('./metadata/' + dir + '.json', 'utf8');
var metaData = JSON.parse(metaData);
};
var configFile = configPath + dir + '.json';
var shaPath = hashPath + dir + '/roms/';
var files = await fsw.readdir(shaPath);
@ -270,6 +274,9 @@ io.on('connection', async function (socket) {
}
};
};
if ((dir == 'arcade') && (metaData.hasOwnProperty(name)) && (metaData[name].hasOwnProperty('cloneof'))) {
Object.assign(config.items[name], {'cloneof': metaData[name].cloneof});
};
if (multi_disc !== config.defaults.multi_disc) {
Object.assign(config.items[name], {'multi_disc': multi_disc});
};

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "emulatorjs",
"version": "1.1.0",
"version": "1.1.1",
"description": "Rom and art management utility for generating configuration files for use with the EmulatorJS frontend",
"main": "index.js",
"author": "thelamer",