graphics - fixed 1 empty GPU, display

This commit is contained in:
Sebastian Hildebrandt 2019-01-10 14:08:13 +01:00
parent e4136624f2
commit d43ec39352

View File

@ -187,7 +187,7 @@ function graphics(callback) {
if (_3dcontrollerpos !== -1 && vgapos === -1) {
vgapos = _3dcontrollerpos;
}
if (Object.keys(currentController).length > 0) {// already a controller found
if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== -1 || currentController.vramDynamic) { // already a controller found
controllers.push(currentController);
currentController = {
vendor: '',
@ -246,7 +246,7 @@ function graphics(callback) {
}
}
}
if (Object.keys(currentController).length > 0) {// still controller information available
if (currentController.vendor || currentController.model || currentController.bus || currentController.vram !== -1 || currentController.vramDynamic) { // already a controller found
controllers.push(currentController);
}
return (controllers);
@ -325,7 +325,7 @@ function graphics(callback) {
for (let i = 1; i < lines.length; i++) { // start with second line
if ('' !== lines[i].trim()) {
if (' ' !== lines[i][0] && '\t' !== lines[i][0] && lines[i].toLowerCase().indexOf(' connected ') !== -1) { // first line of new entry
if (Object.keys(currentDisplay).length > 0) { // push last display to array
if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizex !== -1 || currentDisplay.pixeldepth !== -1 || currentDisplay.resolutionx !== -1) { // push last display to array
displays.push(currentDisplay);
currentDisplay = {
model: '',
@ -369,7 +369,7 @@ function graphics(callback) {
}
// pushen displays
if (Object.keys(currentDisplay).length > 0) { // still information there
if (currentDisplay.model || currentDisplay.main || currentDisplay.builtin || currentDisplay.connection || currentDisplay.sizex !== -1 || currentDisplay.pixeldepth !== -1 || currentDisplay.resolutionx !== -1) { // still information there
displays.push(currentDisplay);
}
return displays;