Actor does not need to be in cache

main
bashrc 2026-02-02 14:18:59 +00:00
parent 5751419290
commit 13afb3e47b
1 changed files with 14 additions and 15 deletions

View File

@ -1310,13 +1310,12 @@ def get_actor_type(base_dir: str, actor: str, person_cache: {}) -> str:
"""Returns the type of actor """Returns the type of actor
""" """
actor = get_actor_from_post_id(actor) actor = get_actor_from_post_id(actor)
if not person_cache.get(actor): if person_cache.get(actor):
return '' return ''
if person_cache[actor].get('actor'): if person_cache[actor].get('actor'):
if person_cache[actor]['actor'].get('type'): if person_cache[actor]['actor'].get('type'):
if isinstance(person_cache[actor]['actor']['type'], str): if isinstance(person_cache[actor]['actor']['type'], str):
return person_cache[actor]['actor']['type'] return person_cache[actor]['actor']['type']
else:
# Try to obtain from the cached actors # Try to obtain from the cached actors
cached_actor_filename = \ cached_actor_filename = \
base_dir + '/cache/actors/' + (actor.replace('/', '#')) + '.json' base_dir + '/cache/actors/' + (actor.replace('/', '#')) + '.json'