learningequality/ka-lite — pull request #429 by dylanjbarth (2013-08-09 00:16:52+00:00)
Title: Subtitles immediate fix

This addresses [#128](https://github.com/learningequality/ka-lite/issues/128). It is a temporary fix for the upcoming release.

Behavior changes:
1. Instead of downloading subtitles from Amara.org, we now cache them on the central server and expose them for download at a static URL (ex: kalite.adhocsync.com/static/srt//.srt
2. Distributed servers now download from the central server rather than Amara.org.
3. (small change) User can now see how many subtitles are available for each language on the Update page.

Code changes:
1. The addition of two management commands to gather information from Amara's API about which subtitles exist and to download and store the subtitles.
2. Added subtitles utilities that generate current counts of srt files available and make reasonably efficient requests
3. Changed the subtitledownload command to 1) point to central server and 2) only make requests when the subtitle is available.

Testing:
1. The management commands can be run with the following + -h for usage help.
* python manage.py generate_subtitle_map
* python manage.py cache_subtitles
2. You will need to set up a test central server with the data and files downloaded by the scripts above, and then try to download from that central_server with a distributed server instance.

I have tested manually, but there were frequent changes of plan, and this is a pretty big code dump... :sheep: