mirror of https://gitlab.com/bashrc2/epicyon
contentMap language for pinned posts
parent
f5cbc7f8ee
commit
9daac007f7
10
daemon.py
10
daemon.py
|
@ -9569,13 +9569,13 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
path: str,
|
path: str,
|
||||||
httpPrefix: str,
|
httpPrefix: str,
|
||||||
nickname: str, domain: str,
|
nickname: str, domain: str,
|
||||||
domainFull: str):
|
domainFull: str, systemLanguage: str):
|
||||||
"""Returns the featured posts collections in
|
"""Returns the featured posts collections in
|
||||||
actor/collections/featured
|
actor/collections/featured
|
||||||
"""
|
"""
|
||||||
featuredCollection = \
|
featuredCollection = \
|
||||||
jsonPinPost(baseDir, httpPrefix,
|
jsonPinPost(baseDir, httpPrefix,
|
||||||
nickname, domain, domainFull)
|
nickname, domain, domainFull, systemLanguage)
|
||||||
msg = json.dumps(featuredCollection,
|
msg = json.dumps(featuredCollection,
|
||||||
ensure_ascii=False).encode('utf-8')
|
ensure_ascii=False).encode('utf-8')
|
||||||
msglen = len(msg)
|
msglen = len(msg)
|
||||||
|
@ -10795,7 +10795,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
getPinnedPostAsJson(self.server.baseDir,
|
getPinnedPostAsJson(self.server.baseDir,
|
||||||
self.server.httpPrefix,
|
self.server.httpPrefix,
|
||||||
nickname, self.server.domain,
|
nickname, self.server.domain,
|
||||||
self.server.domainFull)
|
self.server.domainFull,
|
||||||
|
self.server.systemLanguage)
|
||||||
messageJson = {}
|
messageJson = {}
|
||||||
if pinnedPostJson:
|
if pinnedPostJson:
|
||||||
postId = pinnedPostJson['id']
|
postId = pinnedPostJson['id']
|
||||||
|
@ -10827,7 +10828,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.path,
|
self.path,
|
||||||
self.server.httpPrefix,
|
self.server.httpPrefix,
|
||||||
nickname, self.server.domain,
|
nickname, self.server.domain,
|
||||||
self.server.domainFull)
|
self.server.domainFull,
|
||||||
|
self.server.systemLanguage)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not htmlGET and \
|
if not htmlGET and \
|
||||||
|
|
8
posts.py
8
posts.py
|
@ -1342,7 +1342,7 @@ def undoPinnedPost(baseDir: str, nickname: str, domain: str) -> None:
|
||||||
|
|
||||||
def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
|
def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
|
||||||
nickname: str, domain: str,
|
nickname: str, domain: str,
|
||||||
domainFull: str) -> {}:
|
domainFull: str, systemLanguage: str) -> {}:
|
||||||
"""Returns the pinned profile post as json
|
"""Returns the pinned profile post as json
|
||||||
"""
|
"""
|
||||||
accountDir = acctDir(baseDir, nickname, domain)
|
accountDir = acctDir(baseDir, nickname, domain)
|
||||||
|
@ -1363,7 +1363,7 @@ def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
|
||||||
],
|
],
|
||||||
'content': pinnedContent,
|
'content': pinnedContent,
|
||||||
'contentMap': {
|
'contentMap': {
|
||||||
'en': pinnedContent
|
systemLanguage: pinnedContent
|
||||||
},
|
},
|
||||||
'id': actor + '/pinned',
|
'id': actor + '/pinned',
|
||||||
'inReplyTo': None,
|
'inReplyTo': None,
|
||||||
|
@ -1382,13 +1382,13 @@ def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
|
||||||
|
|
||||||
def jsonPinPost(baseDir: str, httpPrefix: str,
|
def jsonPinPost(baseDir: str, httpPrefix: str,
|
||||||
nickname: str, domain: str,
|
nickname: str, domain: str,
|
||||||
domainFull: str) -> {}:
|
domainFull: str, systemLanguage: str) -> {}:
|
||||||
"""Returns a pinned post as json
|
"""Returns a pinned post as json
|
||||||
"""
|
"""
|
||||||
pinnedPostJson = \
|
pinnedPostJson = \
|
||||||
getPinnedPostAsJson(baseDir, httpPrefix,
|
getPinnedPostAsJson(baseDir, httpPrefix,
|
||||||
nickname, domain,
|
nickname, domain,
|
||||||
domainFull)
|
domainFull, systemLanguage)
|
||||||
itemsList = []
|
itemsList = []
|
||||||
if pinnedPostJson:
|
if pinnedPostJson:
|
||||||
itemsList = [pinnedPostJson]
|
itemsList = [pinnedPostJson]
|
||||||
|
|
Loading…
Reference in New Issue