From: yomguy Date: Wed, 11 May 2011 15:39:42 +0000 (+0200) Subject: add TELEMETA_STREAMING_FORMATS to settings in order to open some formats to streaming. X-Git-Tag: 1.1~206 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=804053dbc8503716ab4941bd860d9e27e74cc38e;p=telemeta.git add TELEMETA_STREAMING_FORMATS to settings in order to open some formats to streaming. TELEMETA_DOWNLOAD_ENABLED now just rules the display of the download section. --- diff --git a/INSTALL b/INSTALL index 38ddc927..f1492d4e 100644 --- a/INSTALL +++ b/INSTALL @@ -149,6 +149,7 @@ Add the following variables: TELEMETA_CACHE_DIR = absolute path to the cache directory that you just created TELEMETA_GMAP_KEY = your Google Map API key TELEMETA_DOWNLOAD_ENABLED = True to enable audio data download + TELEMETA_STREAMING_FORMATS = tuple of authoized streaming formats. Ex : ('mp3', 'ogg') TELEMETA_PUBLIC_ACCESS_PERIOD = number of years above which item files are automagically published EMAIL_HOST = your default SMTP server DEFAULT_FROM_EMAIL = the default sending email address diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 1979c9bc..948b91d4 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -495,7 +495,7 @@ class WebView(object): item = MediaItem.objects.get(public_id=public_id) public_access = self.get_public_access(item.public_access, item.recorded_from_date, item.recorded_to_date) - if (not public_access or not settings.TELEMETA_DOWNLOAD_ENABLED) and not request.user.is_staff: + if (not public_access or not extension in settings.TELEMETA_STREAMING_FORMATS) and not request.user.is_staff: return HttpResponseRedirect('not_allowed/') for encoder in self.encoders: