mirror of https://gitlab.com/bashrc2/epicyon
Avoid content label duplicates
parent
75c17914e7
commit
72fe30a5e5
|
|
@ -56,6 +56,7 @@ def get_labels_from_json(json_object: {}) -> []:
|
|||
if label_str:
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
break
|
||||
if label_str not in labels:
|
||||
labels.append(label_str)
|
||||
# limit the number of labels
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
|
|
@ -68,6 +69,7 @@ def get_labels_from_json(json_object: {}) -> []:
|
|||
if isinstance(tag_dict['href'], str):
|
||||
if resembles_url(tag_dict['href']):
|
||||
label_str += '###' + tag_dict['href']
|
||||
if label_str not in labels:
|
||||
labels.append(label_str)
|
||||
# limit the number of labels
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
|
|
@ -79,6 +81,7 @@ def get_labels_from_json(json_object: {}) -> []:
|
|||
if isinstance(tag_dict['href'], str):
|
||||
if resembles_url(tag_dict['href']):
|
||||
label_str += '###' + tag_dict['href']
|
||||
if label_str not in labels:
|
||||
labels.append(label_str)
|
||||
# limit the number of labels
|
||||
if len(labels) >= MAX_CONTENT_LABELS:
|
||||
|
|
|
|||
Loading…
Reference in New Issue