richard
richard copied to clipboard
rework video links that belong to a Video
A Video can have 4 video urls associated with it for downloads. We use this to generate RSS enclosures as well.
This isn't willdly useful, though. We should generalize it so that we can handle 5 video urls of any type rather than 4 typed video urls. Then add some code to the Video model for managing those (adding videos, removing videos, etc).
Alternatively, we could make this a one-to-many relationship in the DB. That'd be better from a DB-architecture stand-point, but I don't want to keep complexifiying the JSON API.
Anyhow, this issue covers figuring out what the plan should be, implementing it and generating a data migration to migrate the existing data to the new structure.
@CarlFK was asking about the case where he updates multiple files of the same time. For example, when he archives to rackspace cloudfiles and to archive.org, would we want to list all sources for that media type?
I'm wondering about the tendency to complexify the api too. nice word. I'd like thoughts on that. Is it a concern that we'd end up making queries with a lot of joins?
one-to-many relationship please.
The api will be similar to speakers, tags, and the upcoming related_urls.
Working with the flat structured api is making my client code messy. I think a one-to-many relationship will be cleaner code on both sides, and more functional.
I think this is up what is need to be reimplemented to preserve the current features:
settings.py 58:MEDIA_PREFERENCE = ('ogv', 'webm', 'mp4', 'flv',)
videos/models.py 38 MIMETYPES_MAP = { 39 'ogv': 'video/ogg', 40 'mp4': 'video/mp4', 41 'webm': 'video/webm', 42 'flv': 'video/x-flv' 43 }
204: video_ogv_length = models.IntegerField(null=True, blank=True) 205: video_ogv_url = models.URLField(max_length=255, null=True, blank=True) 206: video_ogv_download_only = models.BooleanField(default=False) 355: self.video_ogv_url,
repeat for 'ogv', 'webm', 'mp4', 'flv'
I see 2 tables: video_type and video_url type: name, sequence, mimetype url: video, type, url, length, download_only
additional features: url.label - human readable to display under Download, like "archive.org" or "rackspace cdn"