-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParentId and Parent are inconsistent in Comment class #121
Comments
Try again with the latest, there was some restructuring that I think may have fixed this. It may still be an issue though that needs addressed. |
* Add Link property; use this instead of Parent. * Make Link property of type Post.
So question: should we use The |
@justcool393 yes, I'd say anything that needs a request and is NOT included in the JSON directly should be the It is also probably worth while to be more explicit with |
@CrustyJew Considering all code that initializes comments currently already requested the post and put it through to obtain the current comment, I think that using the GetPost system would be bad as we would have already made the request and can easily be throwing the few things that are required for initial post setup. A similar case can be made for making the Post having an initialized Subreddit that fills all the data in once we want to actually use the object, and having the Subreddit fill in the only basics that we need and already have (e.g. the name of the subreddit is returned by default when you get a list of comments for a post), so I think the idea of having to use the GetX syntax a bit weird since the class should already have the basic needs to be initialized, maybe having the classes internally have a bool IsInitialized that gets set once everything other than the basics gets requested to be filled in? I don't know, I'm just throwing out some ideas here |
@chuggafan Is a post initialized when using |
It doesn't even return a json string as far as I am seeing, which is the stupid part |
Well, we do get the |
Oh yes, definitely, but my point is that we could have a system a la: bool Initialized { get; private set; } = false;
public Post(string PostId, IWebAgent agent... /* everything needed to initialize, but has a special parameter that indicates to not initialize the class */)
{
}
public Post(IWebagent agent...) // current constructor
{
Initialized = true;
}
public Listing<Comment> Comments {
get
{
if(!Initialized)
{
// Initialize the comments here
}
}
} Would be something I would not disagree with doing, it would save the extra request while still allowing us to keep the relevant information. I wouldn't say do it exactly as I'm saying right now, but something along the lines that I'm saying should work fine |
@zmarty can you update and check this again. Reddit added an official implementation for this if I'm remembering right and I think it should be included now in RedditSharp. |
I'm going to look into possibly implementing a fix myself, but I just wanted to comment that this issue is still not fixed. My specific problem is that it breaks downloading a post's entire comment tree. |
When examining a leaf (not level 1!) Comment I noticed the ParentId is the id of the parent comment id, but the Parent field is always the Post. So ParentId is the parent comment, but Parent is the parent Post?
I am using NuGet 2.0.0-CI00028
The text was updated successfully, but these errors were encountered: