hirsivaja / plugin.video.areena

YLE Areena plugin for Kodi, using the official API.
GNU General Public License v2.0
29 stars 11 forks source link

Issue #42, Add support for seasons, episode.hash sort #43

Closed vesatoivonen closed 3 years ago

vesatoivonen commented 3 years ago

First step for #42.

This splits series in seasons, if the season data is available through series/items. When used with the new sorting method, episode.hash, episodes are usually ordered properly.

Sometimes the season data is not available (Itse valtiaat, https://external.api.yle.fi/v1/series/items/1-50552097.json) and the old list_series is used as a fallback (episode.hash sort works with that too). I haven't figured out what to do when the season data is littered with likely duplicates with mostly empty seasons (Summeri, https://external.api.yle.fi/v1/series/items/1-3826506.json).

hirsivaja commented 3 years ago

Looks really nice. The empty seasons are a problem. I made one possible solution for that in my latest commit. Not most efficient, we send extra requests to Yle, but seems to work at least. The problem was really bad for "Luottomies", only 2 seasons really, but there were around 6 empty ones.

Other problem I have seen is that episodes of wrong seasons are listed. For example check "Isä Matteon tutkimuksia".

Btw, where did you find that episode.hash sort method? It is not mentioned in the API documentation

vesatoivonen commented 3 years ago

I found episode.hash by investigating the requests made by the areena web client. The web client gets it's seasons from an endpoint (https://areena.api.yle.fi/v1/series//episodes), which also has the number of episodes for each season. This endpoint however doesn't seem to be available in the external api and cannot be authenticated with the same credentials.

hirsivaja commented 3 years ago

It is a bit of a shame that the external API has not been updated after its initial release. In the front page it says "Ylen API on julkaistu 6.5.2015. Ensimmäisessä vaiheessa sen avulla on mahdollista tehdä Areenan kaltaisia palveluita. ". Unfortunately phase two has never been released.

vesatoivonen commented 3 years ago

Maybe we could just ask nicely for updates?

hirsivaja commented 3 years ago

I asked for updates from the API team. They finally responded, but with some bad news for this plugin. They are actually planning to limit the functionality on the external API and focus only in their internal API. There is no timeline yet so I don't know when these changes would happen.