Include post id in speaker endpoint, for viewing or replies

merge-requests/21/head
Bob Mottram 2021-03-04 10:34:23 +00:00
parent 667bfb938d
commit c3ddbf9b8e
1 changed files with 7 additions and 3 deletions

View File

@ -248,7 +248,7 @@ def getSpeakerFromServer(baseDir: str, session,
def _speakerEndpointJson(displayName: str, summary: str, def _speakerEndpointJson(displayName: str, summary: str,
content: str, imageDescription: str, content: str, imageDescription: str,
links: [], gender: str) -> {}: links: [], gender: str, postId: str) -> {}:
"""Returns a json endpoint for the TTS speaker """Returns a json endpoint for the TTS speaker
""" """
speakerJson = { speakerJson = {
@ -256,7 +256,8 @@ def _speakerEndpointJson(displayName: str, summary: str,
"summary": summary, "summary": summary,
"say": content, "say": content,
"imageDescription": imageDescription, "imageDescription": imageDescription,
"detectedLinks": links "detectedLinks": links,
"id": postId
} }
if gender: if gender:
speakerJson['gender'] = gender speakerJson['gender'] = gender
@ -403,9 +404,12 @@ def _postToSpeakerJson(baseDir: str, nickname: str, domain: str,
announcedHandle = announcedNickname + '@' + announcedDomain announcedHandle = announcedNickname + '@' + announcedDomain
content = \ content = \
translate['announces'] + ' ' + announcedHandle + '. ' + content translate['announces'] + ' ' + announcedHandle + '. ' + content
postId = None
if postJsonObject['object'].get('id'):
postId = postJsonObject['object']['id']
return _speakerEndpointJson(speakerName, summary, return _speakerEndpointJson(speakerName, summary,
content, imageDescription, content, imageDescription,
detectedLinks, gender) detectedLinks, gender, postId)
def updateSpeaker(baseDir: str, nickname: str, domain: str, def updateSpeaker(baseDir: str, nickname: str, domain: str,