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

Search mods by slug instead of generic search #44

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

BitBlitObviMormon
Copy link

Should fix #43. If a more generic search is necessary, some edits can be made.

@way2muchnoise
Copy link
Owner

Using only slug or name is too limited, maybe a fall back to slug when name yields no results?

@BitBlitObviMormon
Copy link
Author

BitBlitObviMormon commented Nov 17, 2022

Using only slug or name is too limited, maybe a fall back to slug when name yields no results?

Really? It seems to me that the code limits the search to slugs only down here anyway:

results = json.loads(api_response.read())['data']
for result in results:
if result['slug'] == search_slug:
return result

There's no other conditional searches that follow or precede it. All it does is search and look for a slug with the name of the search filter in lowercase. I'll run the code and see if it works for each scenario, though now that I look at the code it seems I'll need to give get_downloads_author() some more attention. Simply searching for a slug might not work there.

@BitBlitObviMormon BitBlitObviMormon marked this pull request as draft November 17, 2022 18:25
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 this pull request may close these issues.

Generic titles are not found in API search
2 participants