SRGSSR / srgdataprovider-apple

A library to retrieve SRG SSR unified metadata
MIT License
0 stars 1 forks source link

Update medias and shows by URNs after IL update #23

Closed pyby closed 5 years ago

pyby commented 5 years ago

Issue type

Improvement

Description of the problem

IL API improved the media list by urns and show list by urns API, with no 404response anymore.

https://srfmmz.atlassian.net/browse/PLAY-758 https://srfmmz.atlassian.net/browse/PLAY-759

pyby commented 5 years ago

After our requests, The team also updated all "list" end points:

We changed the API-Design. When a requested domain object contains a list without items the object will now be serialized with an empty list. Before we returned an empty JSON. These domain objects are concerned:
- channelList
- episodeWithMediasList
- eventConfigList
- mediaScheduledLivestreamList
- mediaList
- moduleConfigList
- searchResultListMedia
- searchResultListShow
- showCharacterList
- showList
- songList
- topicList
e.g.: https://il.srgssr.ch/integrationlayer/2.0/srf/mediaList/video/latestByTopic/1.json vs. https://il-test.srgssr.ch/integrationlayer/2.0/srf/mediaList/video/latestByTopic/1.json

Example: https://il.srgssr.ch/integrationlayer/2.0/srf/mediaList/video/latestByTopic/1.json

pyby commented 5 years ago

The changed API can be also tested on RSI test editorial requests, which has only 2 items: https://il-test.srgssr.ch/integrationlayer/2.0/rsi/mediaList/video/editorial.json?pageSize=2 Next URL is now : https://il-test.srgssr.ch/integrationlayer/2.0/rsi/mediaList/video/editorial.json?next=4c121f9f3e50606447bc5b3de0c652c4fbb3e0c95caec9af06433f1ec96a2d3c0c1449385d864031 : { "mediaList" : [ ] }

defagos commented 5 years ago

I just reviewed the changes. From a code perspective everything seems fine.

The tests (run against the test IL) have issues because of many invalid URNs, but the tests related to the change pass successfully. Well, almost, since I found two potential issues:

defagos commented 5 years ago

In the meantime, we should not close the branch.

pyby commented 5 years ago

How could we know if a topic urn is valid or not? There is no topic API, only a topic list API: http://www.srfcdn.ch/developer-docs/integrationlayer/api/public/swagger/index.html#/TopicList

Is it the role of a mediaList to returns 404 if the topic urn is invalid? After a discussion with @defagos @SebastienChauvin and @StaehliJ , we opened an issue for the Play IL team.