]> git.parisson.com Git - telemeta.git/commitdiff
add TELEMETA_STREAMING_FORMATS to settings in order to open some formats to streaming.
authoryomguy <yomguy@parisson.com>
Wed, 11 May 2011 15:39:42 +0000 (17:39 +0200)
committeryomguy <yomguy@parisson.com>
Wed, 11 May 2011 15:39:42 +0000 (17:39 +0200)
TELEMETA_DOWNLOAD_ENABLED now just rules the display of the download section.

INSTALL
telemeta/web/base.py

diff --git a/INSTALL b/INSTALL
index 38ddc927c0e10e09a9d43f18f6c9064f03baba33..f1492d4e76590e35d4b6c4ec9dff5ae286f3f33f 100644 (file)
--- 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 
index 1979c9bc585cef9bad1049573f21c3690d9dd9a2..948b91d4a03a4ee23be34e67ffcbfc1740d0164f 100644 (file)
@@ -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: