hasgeek.tv
hasgeek.tv copied to clipboard
RSS/Atom feeds
HasGeek TV needs RSS or Atom feeds per channel and per playlist.
- The per-playlist version is a list of all videos in the playlist, sorted by
playlists_videos.created_at. Don't useupdated_atas that will change when the playlist order changes. - 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
Change of plans:
- 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.
- The per-channel version uses the stream playlist as described in #60, also presented in reverse (most recent first).
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.
Initial feed support has been added in 6cfecd1. Todo: feed links from the view page.