Use first value from speakable text

main
Bob Mottram 2021-03-25 14:31:34 +00:00
parent 6492264990
commit 20476173cc
1 changed files with 4 additions and 4 deletions

View File

@ -704,7 +704,7 @@ def _readLocalBoxPost(session, nickname: str, domain: str,
_textOnlyContent(postJsonObject2['object']['content']) _textOnlyContent(postJsonObject2['object']['content'])
content += _getImageDescription(postJsonObject2) content += _getImageDescription(postJsonObject2)
messageStr, detectedLinks = \ messageStr, detectedLinks = \
speakableText(baseDir, content, translate) speakableText(baseDir, content, translate)[0]
sayStr = content sayStr = content
_sayCommand(sayStr, messageStr, screenreader, _sayCommand(sayStr, messageStr, screenreader,
systemLanguage, espeak) systemLanguage, espeak)
@ -726,7 +726,7 @@ def _readLocalBoxPost(session, nickname: str, domain: str,
return {} return {}
content = _safeMessage(content) content = _safeMessage(content)
messageStr, detectedLinks = speakableText(baseDir, content, translate) messageStr, detectedLinks = speakableText(baseDir, content, translate)[0]
if screenreader: if screenreader:
time.sleep(2) time.sleep(2)
@ -790,7 +790,7 @@ def _desktopShowActor(baseDir: str, actorJson: {}, translate: {},
if actorJson.get('summary'): if actorJson.get('summary'):
sayStr = html.unescape(removeHtml(actorJson['summary'])) sayStr = html.unescape(removeHtml(actorJson['summary']))
sayStr = sayStr.replace('"', "'") sayStr = sayStr.replace('"', "'")
sayStr2 = speakableText(baseDir, sayStr, translate) sayStr2 = speakableText(baseDir, sayStr, translate)[0]
_sayCommand(sayStr, sayStr2, screenreader, systemLanguage, espeak) _sayCommand(sayStr, sayStr2, screenreader, systemLanguage, espeak)
@ -2303,7 +2303,7 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
if postJsonObject: if postJsonObject:
content = postJsonObject['object']['content'] content = postJsonObject['object']['content']
messageStr, detectedLinks = \ messageStr, detectedLinks = \
speakableText(baseDir, content, translate) speakableText(baseDir, content, translate)[0]
linkOpened = False linkOpened = False
for url in detectedLinks: for url in detectedLinks:
if '://' in url: if '://' in url: