diff --git a/inbox.py b/inbox.py index 59ed67f6d..bef69c55c 100644 --- a/inbox.py +++ b/inbox.py @@ -227,8 +227,6 @@ def store_hash_tags(base_dir: str, nickname: str, domain: str, print('Creating tags directory') os.mkdir(tags_dir) - hashtag_categories = get_hashtag_categories(base_dir) - hashtags_ctr = 0 for tag in post_json_object['object']['tag']: 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 category_filename = tags_dir + '/' + tag_name + '.category' if not os.path.isfile(category_filename): + hashtag_categories = get_hashtag_categories(base_dir) category_str = \ guess_hashtag_category(tag_name, hashtag_categories) if category_str: