From 3cfb28d5f904f7f4ca1d2235440d1d7151ff1f5e Mon Sep 17 00:00:00 2001 From: Robert Meyer Date: Wed, 21 Mar 2018 21:33:08 +0100 Subject: [PATCH] adding active votes to posts --- trufflepig/bchain/checkops.py | 6 +++--- trufflepig/bchain/getdata.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/trufflepig/bchain/checkops.py b/trufflepig/bchain/checkops.py index 6932d16..c6071d1 100644 --- a/trufflepig/bchain/checkops.py +++ b/trufflepig/bchain/checkops.py @@ -195,15 +195,15 @@ def get_parent_posts(comment_authors_and_permalinks, steem): post = { 'title': p.title, 'reward': p.reward.amount, - 'votes': len(p.active_votes), + 'votes': len([x for x in p.active_votes if x['percent'] > 0]), + 'active_votes': p.active_votes, 'created': p.created, 'tags': p.tags, 'body': p.body, 'author': p.author, 'permalink': p.permlink, 'comment_author': comment_author, - 'comment_permalink': comment_permalink, - 'active_votes': p.active_votes + 'comment_permalink': comment_permalink } posts.append(post) diff --git a/trufflepig/bchain/getdata.py b/trufflepig/bchain/getdata.py index d090c71..f474af4 100644 --- a/trufflepig/bchain/getdata.py +++ b/trufflepig/bchain/getdata.py @@ -251,7 +251,8 @@ def get_post_data(authors_and_permalinks, steem, exclusion_voters): post = { 'title': p.title, 'reward': p.reward.amount, - 'votes': len(p.active_votes), + 'votes': len([x for x in p.active_votes if x['percent'] > 0]), + 'active_votes': p.active_votes, 'created': p.created, 'tags': p.tags, 'body': p.body,