From 6e8eb2b73149dfb6efedfda0b9b7f68ebc8074dd Mon Sep 17 00:00:00 2001 From: Penwywern Date: Thu, 25 Apr 2024 17:30:48 +0200 Subject: [PATCH] core: Fix OBS version reported as unparseable --- checks/core.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/checks/core.py b/checks/core.py index ab30078..662166a 100644 --- a/checks/core.py +++ b/checks/core.py @@ -47,18 +47,15 @@ def checkCPU(lines): def getOBSVersionLine(lines): versionLines = search('OBS', lines) - correctLine = 0 - if 'uploaded' in versionLines[correctLine]: - correctLine += 1 - if 'already running' in versionLines[correctLine]: - correctLine += 1 - if 'multiple instances' in versionLines[correctLine]: - correctLine += 1 - if 'windows from screen capture' in versionLines[correctLine]: - correctLine += 1 - if 'Lenovo Vantage / Legion Edge is installed' in versionLines[correctLine]: - correctLine += 1 - return versionLines[correctLine] + wrongLines = ('uploaded', + 'already running', + 'multiple instances', + 'windows from screen capture', + 'Lenovo Vantage / Legion Edge is installed') + for line in versionLines: + if not any(wrongLine in line for wrongLine in wrongLines): + return line + return versionLines[-1] def getOBSVersionString(lines):