diff --git a/metadata.py b/metadata.py index bb6ff9820..c2e18b763 100644 --- a/metadata.py +++ b/metadata.py @@ -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 diff --git a/utils.py b/utils.py index d78547a8c..de55afd78 100644 --- a/utils.py +++ b/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):