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

Generic titles are not found in API search #43

Open
BitBlitObviMormon opened this issue Nov 14, 2022 · 2 comments · May be fixed by #44
Open

Generic titles are not found in API search #43

BitBlitObviMormon opened this issue Nov 14, 2022 · 2 comments · May be fixed by #44

Comments

@BitBlitObviMormon
Copy link

Certain mod names seem to return an error image on my browser instead of the relevant statistics; there doesn't appear to be any rhyme or reason as to which mod names work and which don't. Are these issues happening for everyone or is my web browser broken? (You're welcome to check the links, I believe they're correct.)

These throw an error for me

not-enough-crashes   Not Enough Crashes (Fabric)
tinkers-construct   Tinker's Construct
create   Create

While these work normally

flywheel   Flywheel
inmis   Inmis
cloth-config   Cloth Config

@BitBlitObviMormon
Copy link
Author

BitBlitObviMormon commented Nov 14, 2022

I think I've discovered the issue. All of the titles that worked for me found the title when it searched for the app in this API call:

api_response = api_call.open(API_URL + '/v1/mods/search?gameId=432&pagesize=50&searchFilter=' + search_string)

All of the other titles were too generic to be found under the 50-page limit. Mods that contained more than one word pulled up results for each word rather than excluding results that didn't contain both words. Perhaps mods can be searched directly by their slug instead of the regular search? Simply increasing the page size probably won't fix the issue here.

@BitBlitObviMormon BitBlitObviMormon changed the title Server throws error for certain mods Generic titles are not found in API search Nov 14, 2022
@BitBlitObviMormon
Copy link
Author

BitBlitObviMormon commented Nov 15, 2022

Yes, I believe it works. The code can be changed to this:
api_response = api_call.open(API_URL + '/v1/mods/search?gameId=432&pagesize=50&slug=' + search_string)

It causes all of the faulty examples above to work, I think. I can't test the code on my end, but making the request on my browser seems to work fine. I'll submit a pull request.

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

Successfully merging a pull request may close this issue.

1 participant