hasgeek / hasgeek.tv

Hasgeek TV
http://hasgeek.tv
16 stars 6 forks source link

RSS/Atom feeds #55

Open jace opened 11 years ago

jace commented 11 years ago

HasGeek TV needs RSS or Atom feeds per channel and per playlist.

  1. The per-playlist version is a list of all videos in the playlist, sorted by playlists_videos.created_at. Don't use updated_at as that will change when the playlist order changes.
  2. The per-channel version is a list of all videos that were originally added to a playlist owned by the channel. The query for this is Video.query.filter(Video.playlist.in_(channel.playlists).order_by('created_at')

I'm uncomfortable using created_at in a user-facing query, but I don't think we have another column with the same data.

You can borrow the Atom feed template and code from Eventframe. See feed.xml and related code

jace commented 11 years ago

Change of plans:

  1. The per-playlist version uses the playlist's sorting order, in reverse. That is, the last item in the playlist is the first item in the feed.
  2. The per-channel version uses the stream playlist as described in #60, also presented in reverse (most recent first).
jace commented 11 years ago

The feed should also include attachments for downloading and offline viewing. We need to check on the APIs for all sources to find and include download links in the feed.

If there are multiple download links available (for eg, video at various resolutions), we should pick the best for mobile.

This will require caching the download link in the Video model as querying the API every time the feed is requested is not tenable.

jace commented 11 years ago

Initial feed support has been added in 6cfecd1. Todo: feed links from the view page.