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

[FIX] Disable basic Tenor parameter #11

Merged

Conversation

anthlasserre
Copy link
Contributor

@Thanasis1101 Followed to the recent package update with the new feature. An error occurred while searching a GIF.
"media_filter": "basic", Tenor URL Parameter limit the returned object and doesn't return mediumgif url.

We have to remove it.

image

@Thanasis1101 Thanasis1101 added the bug Something isn't working label Apr 12, 2021
@Thanasis1101 Thanasis1101 self-requested a review April 12, 2021 17:06
@Thanasis1101 Thanasis1101 merged commit 90aa02a into Thanasis1101:master Apr 12, 2021
@Thanasis1101
Copy link
Owner

@anthlasserre thanks for noticing !
I saw your PR and eventually came up with a modification. Consulting the number 6 of the Best Practices from the Tenor API documentation, I reshaped the code so that we use media_filter optimally, according to what previewGifQuality and selectedGifQuality is being used.

Quoting the Tenor API suggestions I consulted:

Use the media_filter parameter to reduce the number of GIF formats returned. This can reduce the response object size by 25-75%.

NAME TYPE DEFAULT VALUE DESCRIPTION
media_filter
STRONGLY RECOMMENDED
string n/a (values: basic | minimal) Reduce the Number of GIF formats returned in the GIF_OBJECT list.

minimal - tinygif, gif, and mp4.
basic - nanomp4, tinygif, tinymp4, gif, mp4, and nanogif

My logic is that if, say that medium is selected for both preview and selected gif, this corresponds to tinygif which will be returned if we set media_filter: "minimal" and will minimize the response object size. Same logic was followed for all possible quality values and I ended up with the final code, which you can check out in this diff.

Updated code was published as v.1.3.2 !

@anthlasserre
Copy link
Contributor Author

@Thanasis1101 Hey mate. I just check your updates. That's perfect. Thank you so much for your quick publish.
Keep in touch for next feature: adapt quality on device connection.

@anthlasserre anthlasserre deleted the fix/tenor-media-filter-param branch April 13, 2021 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants