From 8aeb6738774f6428312bd0889e2aaf4fc9445da0 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 22 Nov 2011 00:09:41 +0100 Subject: [PATCH] Video support is disabled by default, set enable_video to true to enable --- mediagoblin/config_spec.ini | 3 +++ mediagoblin/media_types/__init__.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index eef6f6e0..e5e059c9 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -50,6 +50,9 @@ allow_attachments = boolean(default=False) # Cookie stuff csrf_cookie_name = string(default='mediagoblin_csrftoken') +# Media types +enable_video = boolean(default=False) + [storage:publicstore] storage_class = string(default="mediagoblin.storage.filestorage:BasicFileStorage") base_dir = string(default="%(here)s/user_dev/media/public") diff --git a/mediagoblin/media_types/__init__.py b/mediagoblin/media_types/__init__.py index 2d13f5a6..a2ea6bcb 100644 --- a/mediagoblin/media_types/__init__.py +++ b/mediagoblin/media_types/__init__.py @@ -17,6 +17,7 @@ import os import sys +from mediagoblin import mg_globals from mediagoblin.util import lazy_pass_to_ugettext as _ @@ -29,8 +30,10 @@ class InvalidFileType(Exception): # This should be more dynamic in the future. Perhaps put it in the .ini? # -- Joar MEDIA_TYPES = [ - 'mediagoblin.media_types.image', - 'mediagoblin.media_types.video'] + 'mediagoblin.media_types.image'] + +if mg_globals.app_config['enable_video']: + MEDIA_TYPES.append('mediagoblin.media_types.video') def get_media_types(): -- 2.25.1