tworaz / sailfish-ytplayer

YouTube client for Sailfish OS
Other
32 stars 27 forks source link

Latest videos in subscriptions not sorted #11

Open ejjoman opened 9 years ago

ejjoman commented 9 years ago

The latest videos from my subscriptions are not correctly sorted. They should be sorted by upload time - latest first.

tworaz commented 9 years ago

This was one of the last issues I planned to look at before 0.4.0 release. Unfortunately I don't currently see anything I can do about the problem. The subscriprion pages is currently based on YouTube Activities.List API (https://developers.google.com/youtube/v3/docs/activities/list). There is no other API call I'm aware of that could deliver similar results.

The problem is the API seems to be buggy. First, it does not allow you to actually list only specific content type. An example activity can be something like video upload by the user, an reccomendation, comment for a video or (as in this case) video upload for a channel the user is subscribed to. The API always returns all possible results for all activities at the same time. It's subotpimal because I doubt anybody will be interested in all result types. In most cases only one result type is interesting. Fortunately the response contains the type for each list item so we can at least discatd the results we're not interested in. The problem is we may never know how many results of a given type will the list contain. It's possible that 50 item list will contain only one entry we're interested in. Moreover the API can return different results for the same requests made a couple of miliseconds apart. No idea why that happens. The results are always sorted, but the first one may not contain all the entries that the second one would. My guess is YouTube is not really interested in people creating 3rd party YouTube apps based on this API (wild guess).

Some time ago I've looked into an older (v2) version of YouTube Data API. As I understand the same funcionality worked better there. The problem is v2 will shut down in coming months so there is no point in investing any time in implementing support for it. I kind of hope that v3 will be extended/fixed after v2 access is closed.

I'll keep this ticket opened and update it if anything changes. For 0.4.0 I could not find any good solutions or workarounds.

PureTryOut commented 8 years ago

Almost a year later, does there a solution exist now? The Youtube subscriptions page shows the videos sorted by upload date, has the API this now too?