Use extract_approx_int for comment likes
Full digits no longer available Closes #64 Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
parent
9077596979
commit
a9edc54aac
@ -118,10 +118,11 @@ def post_process_comments_info(comments_info):
|
|||||||
else:
|
else:
|
||||||
comment['view_replies_text'] = str(reply_count) + ' replies'
|
comment['view_replies_text'] = str(reply_count) + ' replies'
|
||||||
|
|
||||||
if comment['like_count'] == 1:
|
if comment['approx_like_count'] == '1':
|
||||||
comment['likes_text'] = '1 like'
|
comment['likes_text'] = '1 like'
|
||||||
else:
|
else:
|
||||||
comment['likes_text'] = str(comment['like_count']) + ' likes'
|
comment['likes_text'] = (str(comment['approx_like_count'])
|
||||||
|
+ ' likes')
|
||||||
|
|
||||||
comments_info['include_avatars'] = settings.enable_comment_avatars
|
comments_info['include_avatars'] = settings.enable_comment_avatars
|
||||||
if comments_info['ctoken']:
|
if comments_info['ctoken']:
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<span class="comment-text">{{ common_elements.text_runs(comment['text']) }}</span>
|
<span class="comment-text">{{ common_elements.text_runs(comment['text']) }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<span class="comment-likes">{{ comment['likes_text'] if comment['like_count'] else ''}}</span>
|
<span class="comment-likes">{{ comment['likes_text'] if comment['approx_like_count'] else ''}}</span>
|
||||||
<div class="button-row">
|
<div class="button-row">
|
||||||
{% if comment['reply_count'] %}
|
{% if comment['reply_count'] %}
|
||||||
{% if settings.use_comments_js and comment['replies_url'] %}
|
{% if settings.use_comments_js and comment['replies_url'] %}
|
||||||
|
@ -284,8 +284,8 @@ def extract_comments_info(polymer_json):
|
|||||||
comment_info['text'] = extract_formatted_text(comment_renderer.get('contentText'))
|
comment_info['text'] = extract_formatted_text(comment_renderer.get('contentText'))
|
||||||
comment_info['time_published'] = extract_str(comment_renderer.get('publishedTimeText'))
|
comment_info['time_published'] = extract_str(comment_renderer.get('publishedTimeText'))
|
||||||
comment_info['like_count'] = comment_renderer.get('likeCount')
|
comment_info['like_count'] = comment_renderer.get('likeCount')
|
||||||
liberal_update(comment_info, 'like_count',
|
comment_info['approx_like_count'] = extract_approx_int(
|
||||||
extract_int(comment_renderer.get('voteCount')))
|
comment_renderer.get('voteCount'))
|
||||||
liberal_update(comment_info, 'reply_count', comment_renderer.get('replyCount'))
|
liberal_update(comment_info, 'reply_count', comment_renderer.get('replyCount'))
|
||||||
|
|
||||||
info['comments'].append(comment_info)
|
info['comments'].append(comment_info)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user