]> git.parisson.com Git - teleforma.git/commitdiff
add random server choice for livestream.url
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 Jan 2023 17:44:06 +0000 (18:44 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 Jan 2023 17:44:06 +0000 (18:44 +0100)
app/settings.py
teleforma/models/core.py

index bc84bfd948d2bbd9a6b1b5fbda860d71f9af5d76..23cdb62e04d30ad4b72f0e67eb59dad9d3e49664 100644 (file)
@@ -273,6 +273,8 @@ EMAIL_SUBJECT_PREFIX = '[' + TELEFORMA_ORGANIZATION + '] '
 
 TELECASTER_LIVE_STREAMING_PROTOCOL = 'https'
 TELECASTER_LIVE_STREAMING_SERVER = 'stream7.parisson.com'
+TELECASTER_LIVE_STREAMING_SERVERS = ['jimmy.parisson.com', 'ron.parisson.com']
+TELECASTER_LIVE_RANDOM_SERVERS = True
 TELECASTER_LIVE_STREAMING_PORT = 443
 TELECASTER_LIVE_ICECAST_STREAMING_PORT = 443
 TELECASTER_LIVE_ICECAST_STREAMING_PATH = '/stream/audio/'
index fc6e8e65e5a8fddfcb67a6e127c7223a4f7dad4d..f964ad30bf764f629b1c93bf69e9d75d3bd4b65a 100755 (executable)
@@ -701,6 +701,11 @@ class LiveStream(models.Model):
 
     @property
     def url(self):
+        if settings.TELECASTER_LIVE_RANDOM_SERVERS:
+            servers = settings.TELECASTER_LIVE_STREAMING_SERVERS
+            server = random.choice(servers)
+        else:
+            server = self.server.host
         return self.server.protocol + '://' + self.server.host + ':' + self.server.port + \
                 self.server.path + self.mount_point