From ddbf6af1e20222882a7ce559804ed48f4ad31a92 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 2 Mar 2013 19:06:31 -0600 Subject: Huge amount of work to (mostly) allow .ogg (and maybe other) formats to skip transcode - Update get_display_media in several ways: - now uses the media type's own declaration of the order of things - returns both the media_size and the media_path, as per the docstring - implicitly uses self.media_files as opposed to forcing you to pass it in - update videos to use get_display_media - update images to declare media_fetch_order in the media manager (videos also) - update stl to use media.media_files['original'] instead of weird use of get_display_media - update sidebar to only conditionally show webm_640 TODO still: identify video type information *during* processing, show that in the element. This commit sponsored by Nathan Yergler. Thanks, nyergler! --- mediagoblin/media_types/image/__init__.py | 6 +++++- mediagoblin/media_types/video/__init__.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'mediagoblin/media_types') diff --git a/mediagoblin/media_types/image/__init__.py b/mediagoblin/media_types/image/__init__.py index 36d7c201..3e167db1 100644 --- a/mediagoblin/media_types/image/__init__.py +++ b/mediagoblin/media_types/image/__init__.py @@ -25,4 +25,8 @@ MEDIA_MANAGER = { "sniff_handler": sniff_handler, "display_template": "mediagoblin/media_displays/image.html", "default_thumb": "images/media_thumbs/image.png", - "accepted_extensions": ["jpg", "jpeg", "png", "gif", "tiff"]} + "accepted_extensions": ["jpg", "jpeg", "png", "gif", "tiff"], + + # Used by the media_entry.get_display_media method + "media_fetch_order": [u'medium', u'original', u'thumb'], +} diff --git a/mediagoblin/media_types/video/__init__.py b/mediagoblin/media_types/video/__init__.py index 3faa5b9f..fd364c02 100644 --- a/mediagoblin/media_types/video/__init__.py +++ b/mediagoblin/media_types/video/__init__.py @@ -26,4 +26,8 @@ MEDIA_MANAGER = { "display_template": "mediagoblin/media_displays/video.html", "default_thumb": "images/media_thumbs/video.jpg", "accepted_extensions": [ - "mp4", "mov", "webm", "avi", "3gp", "3gpp", "mkv", "ogv", "m4v"]} + "mp4", "mov", "webm", "avi", "3gp", "3gpp", "mkv", "ogv", "m4v"], + + # Used by the media_entry.get_display_media method + "media_fetch_order": [u'webm_640', u'original'], +} -- cgit v1.2.3