Skip to content
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

API: Add 'authorVerified' field on recommended videos #4562

Merged

Conversation

ChunkyProgrammer
Copy link
Contributor

@ChunkyProgrammer ChunkyProgrammer requested a review from a team as a code owner April 5, 2024 00:22
@ChunkyProgrammer ChunkyProgrammer requested review from syeopite and removed request for a team April 5, 2024 00:22
Copy link
Member

@syeopite syeopite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rv["author_verified"] is currently returning as a string instead of a bool.

You'll have to modify the video.related_videos property as well as each attribute under it is currently converted into a string.

def related_videos
info["relatedVideos"]?.try &.as_a.map { |h| h.as_h.transform_values &.as_s } || [] of Hash(String, String)
end

@ChunkyProgrammer ChunkyProgrammer marked this pull request as draft April 8, 2024 03:12
@ChunkyProgrammer ChunkyProgrammer marked this pull request as ready for review April 16, 2024 22:22
@ChunkyProgrammer
Copy link
Contributor Author

rv["author_verified"] is currently returning as a string instead of a bool.

You'll have to modify the video.related_videos property as well as each attribute under it is currently converted into a string.

def related_videos
info["relatedVideos"]?.try &.as_a.map { |h| h.as_h.transform_values &.as_s } || [] of Hash(String, String)
end

Other parts of the code assumes that author_verified is a string so I just switched to checking if it's equal to "true" for the api instead of refactoring

@SamantazFox
Copy link
Member

SamantazFox commented Apr 20, 2024

Other parts of the code assumes that author_verified is a string so I just switched to checking if it's equal to "true" for the api instead of refactoring

Yes, the HTML side does if rv["author_verified"]? == "true" too.

@SamantazFox
Copy link
Member

@syeopite One day this will be refactored, but today is not that day x)

@SamantazFox SamantazFox changed the title Add field for authorVerified for recommended videos when using the API API: Add 'authorVerified' field on recommended videos Apr 26, 2024
@SamantazFox SamantazFox merged commit bd549f2 into iv-org:master Apr 26, 2024
6 of 7 checks passed
@ChunkyProgrammer ChunkyProgrammer deleted the add-verified-to-recommended-videos branch April 27, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants