-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support for PostSampleAlternates #4
base: master
Are you sure you want to change the base?
Conversation
…lternates Author: Zevaryx <[email protected]>
Oh my god I just realised I wasn't watching the repository for some reason so I was never notified of your pull request. My bad. I will take a look as soon as I can! |
No worries! I actually forgot about this PR, so not a big deal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the tests still pass? The fake payloads might have to be updated.
Also please rebase onto master!
@@ -48,11 +48,21 @@ pub struct PostPreview { | |||
pub url: Option<String>, | |||
} | |||
|
|||
#[derive(Debug, PartialEq, Eq, Deserialize)] | |||
pub struct PostSampleAlternates { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should probably be singular: PostSampleAlternate
Reasoning
The API now has a field inside of
sample
calledalternates
. This field is usually empty, but is filled when there are different resolution sizes for a sample for videos. See post 2474986 for a rating:s sample. Additionally, with an update between when I first started this patch and now, they added it so every post now has this field (see post 39 for a rating: example of it being applied to an extremely old post).Solution
An extra struct (
PostSampleAlternates
) and an extra field (alternates
) allow for proper handling of this.Example usage: