Closed StaticRocket closed 1 year ago
We can't really limit this in a reasonable manner though. They don't appear to track when a post is saved.
What do you mean?
Hi! Thanks for the PR. Since
save_comments
module looks almost exactly like thesave_posts
, could you just change the existing module to besaved
? and use it for both types?
Sure, but I don't have an account to test this on anymore.
We can't really limit this in a reasonable manner though. They don't appear to track when a post is saved.
What do you mean?
I was going to apply the filtering logic that user post's get and try to allow users to set a "after x" flag, but reddit doesn't seem to make that information available.
I'll can test it before merging.
Yeah, good point. Maybe if the saved thing doesn't have the data of when it was saved and if the time filter is set, just log a warn!
and skip it.
Hi! Thanks for the PR. Since
save_comments
module looks almost exactly like thesave_posts
, could you just change the existing module to besaved
? and use it for both types?Sure, but I don't have an account to test this on anymore.
Actually, wait. Why would you do that? There's only a few lines of reuse and it's technically only in the implementation of the shred trait. I can't think of a slick way to merge them without adding extra overhead.
Scratch that. I've got one last idea but it'll change the call pattern in main for api queries.
Alright @andrewbanchich , first stab at rust's advanced traits. Let me know if this looks sane.
I didn't think you'd need generics / traits at all :smile: The two looks pretty much the same to me. They have the same JSON structure, etc right? What's the purpose of the generic?
If you'd like to revert to the previous commit where it's two files, I can merge the two if that's easier for you. Up to you!
I didn't think you'd need generics / traits at all smile The two looks pretty much the same to me. They have the same JSON structure, etc right? What's the purpose of the generic?
They have the same json structure but the information you attach to them (FILENAME
and TYPE_ID
) are different. I was trying to keep that component the same so that if there are any checks on those traits anywhere else in the project then it's still fine. Maybe I'm still overthinking it...
That's a good point. Since they have different type IDs and different file names, I would prefer to keep them as complete separate types without using generics. Sorry for the confusion!
Great, thank you so much!
Allow users to shred comments and posts through the OAuth API.
We can't really limit this in a reasonable manner though. They don't appear to track when a post is saved.