Closed rgainza closed 7 months ago
I what way is the navigation hindered?
It works the way you have it today. It's just a suggestion.
If you get control, you can choose to get more information from the API. Get smoother navigation page to page. Eq TvShow => showSeasons => showEpisodes
The GraphQL api they have is not always as extensive as you might think. It is very tailored down to match the website.
Just to be clear. Have you figured out how to make GraphQL queries without sha256hash? Everything can be fetched very efficiently from what my knowledge in GraphQL goes.
Of course, but GraphQL is just a language. What data is available and how it is structured is up to who ever is implementing it in their infrastructure.
I'm a bit confused. You can always fetch the same information from the same type. So that makes GraphQL by itself very extensive. I thought it was a good suggestion. That way you could easily create operations that would make it easier to match the information Kodi can add.
To me when I read the python code it looks like you copied the hash and operation names instead of creating them yourselves making you forced to use that structure which was queried for from using that hash.
I know I use the hashes, because those queries are cached and fast and in 90% of the cases contain all data Retropect needs. Your suggestion is to try to create a new nesting structure using actual GraphQL queries. But that is not always possible.
For example: if there is no GraphQL query that returns all seasons for a show then even a custom query won't fix that. GraphQL defines certain queryies. The hashed queries only represent an easy way of determining what data to include for a certain query.
The hashes also predetermine the structure in which way the data will be presented forcing you to fetch the data after that structure. Yeah obviously cache might be a good reason for using the same hashes, but I'd argue that you might have created a plugin that would quickly get those queires cached as well seeing the many users that it has.
Your example is very dooming for a streaming service and I get you probably made that just to make the point clear, but let me answer you anyway. In those cases you handle the exceptions with other queries to get the seasons. If it works for the streaming service. It will work in other cases.
EDIT: Let me add a perfect example for where this could improve the plugin. TV4 does not list the id on the hash query for movies and episodes that are live. Instead they do it on the next page. Change the query and you can already get on the main page.
I guess this issue is no longer relevant as both TV4 and SVT changed significantly since 2022
Feature Request
Is your feature request related to a problem? Please describe
The navigation is probably hindered by the structure of the API since Kodi is one thing and the web complete other matter. Controlling the content you fetch through correct requests might make it easier to structurize the navigation.
Describe the solution you'd like
Send queries to the APIs instead of the standard sha256 hash used by the website that are linked to predetermined structure of the api.
Describe alternatives you've considered
Use your free time however you like!
Additional context
Nothing to add
Maybe other services use GRAPHQL as well. Makes things a lot easier to handle.