learningequality/ka-lite — pull request #1091 by bcipolli (2013-11-22 09:03:23+00:00)
Title: Pre dubbed video support: migrating schema, scrubbing code.

This is dependent on #1084 and addresses #233, #1085, and others. Best to view this PR as commits, as the topic updates are overwhelming otherwise.

This lays the foundation for dubbed video support, by:
* Migrating to a more generic `video_id`, instead of language-specific `youtube_id`, as the foundation for identifying videos in `VideoLog`
* Migrate app to differentiate between `id`, which are unique identifiers, and `slug`, which is a (probably-unique, human readable) piece usable for building URLs.
Each of these were accomplished by renaming variables to be consistent, and adding to the `main/models.py` or `khanload`/`topics.json` schemas.

Potential issues:
* Local dataloss is not an issue; a new field was set in the `VideoLog` model, instead of shifting anything.
* Syncing is the major concern, but there should be no issues:
* UUID calculation migrated from `youtube_id` to `video_id`, but since `video_id` is set to the English video youtube_id, this will be backwards-compatible.
* When syncing with old machines, the `video_id` field will be eliminated. This will cause pain for the unlikely case where a user watched a video in English, and also another dubbed video language, one on a newer install, one on the older.
* In that case, locally, there will not be collision--the user will have two separate logs (but only able to update one).
* On the central server, the dubbed video lookup algorithm will notice these are the same, and will merge them.

Testing:
* Extensive testing was done on `videodownload` and `videoscan` via the "Update Video" page, which all look fantastic now
* Plenty of testing on video viewing, playing, saving, related videos from exercises, topic pages, and that all the green progress bubbles show.
* Some testing on coach reports (particularly tabular view and student view)