mirror of https://gitlab.com/bashrc2/epicyon
Avoid double file access for handles with @ prefix
parent
bf7b53c296
commit
a7e68e3e0e
|
@ -177,6 +177,8 @@ def is_following_actor(base_dir: str,
|
|||
following_file = base_dir + '/accounts/' + handle + '/following.txt'
|
||||
if not os.path.isfile(following_file):
|
||||
return False
|
||||
if actor.startswith('@'):
|
||||
actor = actor[1:]
|
||||
if actor.lower() in open(following_file).read().lower():
|
||||
return True
|
||||
following_nickname = get_nickname_from_actor(actor)
|
||||
|
|
|
@ -32,14 +32,15 @@ def _html_podcast_social_interactions(podcast_properties: {},
|
|||
return ''
|
||||
if not podcast_properties['socialInteract'].get('text'):
|
||||
return ''
|
||||
post_url = podcast_properties['socialInteract']['text']
|
||||
episode_post_url = podcast_properties['socialInteract']['text']
|
||||
|
||||
podcast_str = \
|
||||
'<center>\n' + \
|
||||
' <a href="/users/' + nickname + \
|
||||
'?replyto=' + post_url + '" target="_blank" ' + \
|
||||
'?replyto=' + episode_post_url + '" target="_blank" ' + \
|
||||
'rel="nofollow noopener noreferrer">💬 ' + \
|
||||
translate['Leave a comment'] + '</a>\n' + \
|
||||
' <a href="' + post_url + '" target="_blank" ' + \
|
||||
' <a href="' + episode_post_url + '" target="_blank" ' + \
|
||||
'rel="nofollow noopener noreferrer">' + \
|
||||
translate['View comments'] + '</a>\n' + \
|
||||
'</center>\n'
|
||||
|
|
Loading…
Reference in New Issue