learningequality/ka-lite — pull request #1169 by bcipolli (2013-11-28 21:38:56+00:00)
Title: Efficient url computations

The dubbed video code was not ready to go, but was apparently contained in one of the PRs that I merged to 0.11.1. There were both bugs and bad performance issues in that code--that's why we didn't want to merge it to 0.11.1--and they're causing headaches.

I believe I've worked out the bugs and intentionally introduced a new one, that gets performance back to where it was.
* Instead of computing *all* subtitle URLs and *all* dubbed video URLs across all videos (the latter of which is to determine, cross-language whether any video is available), just check the english youtube ID to tell if a topic is available.
* Load video urls when loading the video, or when you load an exercise that has it as a related vidoe, or when you're a "bottom-level" topic (i.e. contain videos directly)

Testing:
Tons necessary: I've done most, but none dealing with actually downloading things.
* Start server, load homepage
* Start server, load bottom-level topic
* start server, load video
* start server, load exercise
All the same tests again, first loading one of those pages, then browsing to another.
All the same tests again, but then change the # of videos on disk.

Happy Thanksgiving! :bomb: :)