From 92937bf87190b3a53e778c66622ea28b7f5b5a18 Mon Sep 17 00:00:00 2001 From: bashrc Date: Fri, 21 Aug 2026 18:00:26 +0100 Subject: [PATCH] Maximum content labels --- src/utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils.py b/src/utils.py index d8ab7bfc7..f30bb8fc5 100644 --- a/src/utils.py +++ b/src/utils.py @@ -59,6 +59,8 @@ INVALID_ACTOR_URL_CHARACTERS = ( ';', '=' ) +MAX_CONTENT_LABELS = 10 + def is_account_dir(dir_name: str) -> bool: """Is the given directory an account within /accounts ? @@ -4496,11 +4498,11 @@ def get_labels_from_json(json_object: {}) -> []: label_str = label_str.strip() label_str = remove_html(label_str) if label_str: - if len(labels) >= 10: + if len(labels) >= MAX_CONTENT_LABELS: break labels.append(label_str) # limit the number of labels - if len(labels) >= 10: + if len(labels) >= MAX_CONTENT_LABELS: break elif tag_dict['name'] == 'Label': label_str = tag_dict['value'].strip() @@ -4512,7 +4514,7 @@ def get_labels_from_json(json_object: {}) -> []: label_str += '###' + tag_dict['href'] labels.append(label_str) # limit the number of labels - if len(labels) >= 10: + if len(labels) >= MAX_CONTENT_LABELS: break elif tag_dict['type'] == 'Label': label_str = remove_html(tag_dict['name']) @@ -4523,6 +4525,6 @@ def get_labels_from_json(json_object: {}) -> []: label_str += '###' + tag_dict['href'] labels.append(label_str) # limit the number of labels - if len(labels) >= 10: + if len(labels) >= MAX_CONTENT_LABELS: break return labels