From e5d2f69f2f1e712f4989014ad8a07b85fc6207f1 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 22 Oct 2019 19:43:30 +0200 Subject: [PATCH] graphics() improved display detection (windows) --- CHANGELOG.md | 1 + README.md | 2 +- docs/history.html | 5 +++++ docs/index.html | 2 +- lib/graphics.js | 4 ++-- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3782211..02ad75d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.14.17 | 2019-10-22 | `graphics()` improved display detection (windows) | | 4.14.16 | 2019-10-19 | `graphics()` improved display detection (windows) | | 4.14.15 | 2019-10-18 | `graphics()` fallback display detection (windows) | | 4.14.14 | 2019-10-18 | `powerShell()` fixed error handling (windows) | diff --git a/README.md b/README.md index ecc21e5..9cc5983 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ [![Caretaker][caretaker-image]][caretaker-url] [![MIT license][license-img]][license-url] -This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 250 versions published, up to 300,000 downloads per month, > 1 Mio downloads overall. Thank you to all who contributed to this project! +This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 250 versions published, up to 400,000 downloads per month, > 1 Mio downloads overall. Thank you to all who contributed to this project! ## New Version 4.0 diff --git a/docs/history.html b/docs/history.html index d1e148b..e2d13fc 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.14.17 + 2019-10-22 + graphics() improved display detection (windows) + 4.14.16 2019-10-19 diff --git a/docs/index.html b/docs/index.html index e80420f..43d27d5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.14.16
+
Current Version: 4.14.17
diff --git a/lib/graphics.js b/lib/graphics.js index a2e0ffa..ccc2970 100644 --- a/lib/graphics.js +++ b/lib/graphics.js @@ -589,7 +589,7 @@ function graphics(callback) { tsections.shift(); // monitor ID (powershell) - model / vendor - const res = data[5].split(/\r/); + const res = data[5].split(/\r\n/); let isections = []; res.forEach(element => { const parts = element.split('|'); @@ -726,7 +726,7 @@ function graphics(callback) { let displayVendor = ''; let displayModel = ''; isections.forEach(element => { - if (element.instanceId.toLowerCase().startsWith(instanceName)) { + if (element.instanceId.toLowerCase().startsWith(instanceName) && vendor.startsWith('(') && model.startsWith('PnP')) { displayVendor = element.vendor; displayModel = element.model; }