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

The content of method 'searchQuery(key,mediaType,RatingType)' returns wrong #112

Closed
shubingo-android opened this issue Jan 13, 2021 · 4 comments

Comments

@shubingo-android
Copy link

shubingo-android commented Jan 13, 2021

GPHContent,What I pass is the query keyword of sticker, but sometimes it returns me the trending content of gif

@ALexanderLonsky
Copy link
Collaborator

@shubingo-android could you please provide the particular request/response so I can look into it?

@shubingo-android
Copy link
Author

shubingo-android commented Jan 14, 2021

@ALexanderLonsky I loaded it like this:
private void loadGiphyContent() {
try {
if ("Trending".equals(mKey)) {
mView.setGPHContent(TextUtils.equals(GIF_TYPE, mType)
? GPHContent.Companion.getTrendingGifs() :
GPHContent.Companion.getTrendingStickers());
} else {
mView.setGPHContent(GPHContent.Companion.searchQuery(mKey, getMediaType(), RatingType.pg13));
}
} catch (Throwable e) {
e.printStackTrace();
}

 }

private MediaType getMediaType() {
    if (mType.equals(GIF_TYPE)) {
        return GPHContentType.gif.getMediaType();
    } else {
        return GPHContentType.sticker.getMediaType();
    }
}
@Override
public void setGPHContent(GPHContent content) {
    mGifGrideView.setContent(content);
}

I checked the request and response ,the response is right, but When set to GiphyGridView, it sometimes displays trending content,This may happen to both gif and sticker.
Does GiphyGridView load the trending content of gif asynchronously by default. When the default loading is later than the content to be searched, it will display the gif trending content?Because I found it sometimes displays the trending content first, and then displays the correct content.

@ALexanderLonsky
Copy link
Collaborator

@shubingo-android yes, you are right. Please try this version: 2.0.8

@shubingo-android
Copy link
Author

@shubingo-android yes, you are right. Please try this version: 2.0.8

@ALexanderLonsky got it,I have updated to version 2.0.8, It's correct. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants