mirror of https://gitlab.com/bashrc2/epicyon
Get hashtag categories only when needed
parent
726447e1cb
commit
b8b9f9f2fc
3
inbox.py
3
inbox.py
|
@ -227,8 +227,6 @@ def store_hash_tags(base_dir: str, nickname: str, domain: str,
|
||||||
print('Creating tags directory')
|
print('Creating tags directory')
|
||||||
os.mkdir(tags_dir)
|
os.mkdir(tags_dir)
|
||||||
|
|
||||||
hashtag_categories = get_hashtag_categories(base_dir)
|
|
||||||
|
|
||||||
hashtags_ctr = 0
|
hashtags_ctr = 0
|
||||||
for tag in post_json_object['object']['tag']:
|
for tag in post_json_object['object']['tag']:
|
||||||
if not tag.get('type'):
|
if not tag.get('type'):
|
||||||
|
@ -280,6 +278,7 @@ def store_hash_tags(base_dir: str, nickname: str, domain: str,
|
||||||
# automatically assign a category to the tag if possible
|
# automatically assign a category to the tag if possible
|
||||||
category_filename = tags_dir + '/' + tag_name + '.category'
|
category_filename = tags_dir + '/' + tag_name + '.category'
|
||||||
if not os.path.isfile(category_filename):
|
if not os.path.isfile(category_filename):
|
||||||
|
hashtag_categories = get_hashtag_categories(base_dir)
|
||||||
category_str = \
|
category_str = \
|
||||||
guess_hashtag_category(tag_name, hashtag_categories)
|
guess_hashtag_category(tag_name, hashtag_categories)
|
||||||
if category_str:
|
if category_str:
|
||||||
|
|
Loading…
Reference in New Issue