mirror of https://gitlab.com/bashrc2/epicyon
Actor does not need to be in cache
parent
5751419290
commit
13afb3e47b
3
utils.py
3
utils.py
|
|
@ -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'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue