mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-11-01 18:29:54 +00:00
Avoid content label duplicates
This commit is contained in:
1 parent
75c17914e7
commit
72fe30a5e5
1 file changed
+6
-3
@@ -56,7 +56,8 @@ def get_labels_from_json(json_object: {}) -> []:
|
||||
if label_str:
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
break
|
||||
labels.append(label_str)
|
||||
if label_str not in labels:
|
||||
labels.append(label_str)
|
||||
# limit the number of labels
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
break
|
||||
@@ -68,7 +69,8 @@ def get_labels_from_json(json_object: {}) -> []:
|
||||
if isinstance(tag_dict['href'], str):
|
||||
if resembles_url(tag_dict['href']):
|
||||
label_str += '###' + tag_dict['href']
|
||||
labels.append(label_str)
|
||||
if label_str not in labels:
|
||||
labels.append(label_str)
|
||||
# limit the number of labels
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
break
|
||||
@@ -79,7 +81,8 @@ def get_labels_from_json(json_object: {}) -> []:
|
||||
if isinstance(tag_dict['href'], str):
|
||||
if resembles_url(tag_dict['href']):
|
||||
label_str += '###' + tag_dict['href']
|
||||
labels.append(label_str)
|
||||
if label_str not in labels:
|
||||
labels.append(label_str)
|
||||
# limit the number of labels
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
break
|
||||
|
||||
Reference in new issue
Block a user