mirror of
https://github.com/linuxserver/emulatorjs.git
synced 2026-02-23 00:01:26 +08:00
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:
parent
26053d4d34
commit
aec7791e96
@ -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;
|
||||
|
||||
7
index.js
7
index.js
@ -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});
|
||||
};
|
||||
|
||||
4032
metadata/arcade.json
4032
metadata/arcade.json
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user