mirror of https://gitlab.com/bashrc2/epicyon
If summary is not available then try name field
parent
79e14e2f79
commit
b1c4c26cdd
|
@ -97,7 +97,7 @@ def meta_data_node_info(base_dir: str,
|
|||
"text/markdown", "text/x.misskeymarkdown"],
|
||||
"FEPs": ["c648", "521a", "8fcf", "4ccd", "c118", "fffd",
|
||||
"1970", "0837", "7628", "2677", "5e53", "c16b",
|
||||
"5e53", "268d"]
|
||||
"5e53", "268d", "b2b8"]
|
||||
}
|
||||
}
|
||||
return nodeinfo
|
||||
|
|
14
utils.py
14
utils.py
|
@ -573,11 +573,17 @@ def _valid_summary(possible_summary: str) -> bool:
|
|||
def get_summary_from_post(post_json_object: {}, system_language: str,
|
||||
languages_understood: []) -> str:
|
||||
"""Returns the summary from the post in the given language
|
||||
including searching for a matching entry within summaryMap
|
||||
including searching for a matching entry within summaryMap.
|
||||
Also try the "name" field if summary is not available. See
|
||||
https://codeberg.org/fediverse/fep/src/branch/main/fep/b2b8/fep-b2b8.md
|
||||
"""
|
||||
summary_str = \
|
||||
get_content_from_post(post_json_object, system_language,
|
||||
languages_understood, "summary")
|
||||
summary_str = ''
|
||||
for summary_fieldname in ('summary', 'name'):
|
||||
summary_str = \
|
||||
get_content_from_post(post_json_object, system_language,
|
||||
languages_understood, summary_fieldname)
|
||||
if summary_str:
|
||||
break
|
||||
if summary_str:
|
||||
summary_str = summary_str.strip()
|
||||
if not _valid_summary(summary_str):
|
||||
|
|
Loading…
Reference in New Issue