Merge pull request #838 from ouuan/fix-playerctl-log

[contrib/playerctl]: don't log when no player is found
This commit is contained in:
tobi-wan-kenobi 2021-12-17 11:18:27 +01:00 committed by GitHub
commit e590a3cf3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,9 @@ class Module(core.module.Module):
def update(self): def update(self):
try: try:
playback_status = str(util.cli.execute(self.__cmd + "status")).strip() playback_status = str(util.cli.execute(self.__cmd + "status 2>&1 || true", shell = True)).strip()
if playback_status == "No players found":
playback_status = None
except Exception as e: except Exception as e:
logging.exception(e) logging.exception(e)
playback_status = None playback_status = None