-
Notifications
You must be signed in to change notification settings - Fork 28
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
Feature Request: Query categories on demand #455
Comments
It looks like the function to fetch categories is silently failing after some time, or somehow getting stuck. I deleted the docker exec ganymede-db psql -U ganymede ganymede-prd -c "select count(id) from twitch_categories"
count
-------
3401
(1 row) That number seems low. I restarted the API container again and it added some more. docker exec ganymede-db psql -U ganymede ganymede-prd -c "select count(id) from twitch_categories"
count
-------
3917
(1 row) Comparing this to my production instance, a lot are missing. docker exec ganymede-db psql -U ganymede ganymede-prd -c "select count(id) from twitch_categories"
count
-------
35275
(1 row) I'll investigate this some more. I prefer to fetch all the categories at the same the container is started versus querying the Twitch API. I'll get this converted to the new Workflow system and have it run once a day or something. |
Re-familiarizing my self with this API endpoint. The Instead of implementing the search API you linked, I might edit the drop down to allow imputing your own category if it doesn't exist. It's simple and if you're adding a watched channel, chances are you already have the category in mind. |
Would this be a query to |
I was thinking of making the 'enter your own category' be an 'advanced' feature that has no validation (free-form text) to the I'm open to suggestions, not sure how to best proceed. |
I suggested a query because Ganymede currently saves all information about the category into the database; Name, ID, Cover art, IGDB ID (or so it seems): ganymede/internal/twitch/category.go Lines 29 to 45 in 4825322
Given that information is currently saved, I thought it would be used in the future (maybe for Ganymede's own game discovery system, or showing the game art in the chapter selection in the player). I also thought that categories were matched to the vods using IDs and not strings (which isn't the case), and would thus need a query of the game title to know the ID. Since that's not true, you can be local-first by simply string matching the user's inputted custom category to the ones found in the video, which is probably what you were thinking of doing. |
According to your comments on the GetCategories() function, the top 100 categories on Twitch are grabbed, seemingly repeating until there are "no more":
ganymede/internal/twitch/category.go
Lines 47 to 49 in 47727d4
This does not get every category on Twitch (which is probably unreasonable anyway), as I see when trying to add categories such as Minami Lane or Town of Salem 2 to a watched channel, they are not returned in the search box at all:
There is an API endpoint for searching for categories, so it'd be great if there was also an option to search Twitch for categories in the dropdown box, something like this:
which when clicked, would query Twitch with the string currently in the text box (with a
first
value of like, five), then commit new categories to the database and return them to the user.The text was updated successfully, but these errors were encountered: