CrustyJew / RedditSharp-DEPRECATED-

Reddit API wrapper for .NET
MIT License
215 stars 75 forks source link

Comment and Post are missing Upvote Ratio - needed for Downvotes estimation #120

Open zmarty opened 7 years ago

zmarty commented 7 years ago

Some time ago Reddit stopped revealing the actual downvotes count in the API. So downvotes are always set to 0 for Comment and Post instances (this is expected).

The API also returns a JSON field called "upvote_ratio". When combined with the "ups" field we could estimate a value for downvotes.

So my request is: expose upvote_ratio in the Comment and Post classes so I can estimate downvotes.

I am using NuGet 2.0.0-CI00028

CrustyJew commented 7 years ago

Feel free to send in a pull request, otherwise someone will eventually get around to it.

zmarty commented 7 years ago

I looked into this more and also implemented a local version. However, there is a small problem. Based on what I see here and what I read online, upvote_ratio is only populated for a post in the call to comments. So when we get a list of let's say top 25 posts in a subreddit, that data structure does NOT contain upvote_ratio. It's only if you make separate requests for each post that you get it. I believe this has been reported as a bug to Reddit.

CrustyJew commented 7 years ago

I believe this has been reported as a bug to Reddit.

I wouldn't hold my breath for a fix ;) I'd say that if you make it a nullable type and put it in the annotations for the method about how/when it is filled that'll work for now.

justcool393 commented 6 years ago

Will add this once the PR for #119 gets merged. I'm not too familiar with merge conflicts in Git, but I want to avoid them if at all possible.

justcool393 commented 6 years ago

By the way, this is an intentional thing to require a single submission to be called.