#132 | #121: backoffice / dev-1.0-121 (#131)

cfr #121

Co-authored-by: Christophe Siraut <d@tobald.eu.org>
Co-authored-by: bkfox <thomas bkfox net>
Co-authored-by: Thomas Kairos <thomas@bkfox.net>
Reviewed-on: rc/aircox#131
Co-authored-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
Co-committed-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
This commit is contained in:
2024-04-28 22:02:09 +02:00
committed by Thomas Kairos
parent 1e17a1334a
commit 55123c386d
348 changed files with 124397 additions and 17879 deletions

View File

@ -8,8 +8,7 @@ import subprocess
import psutil
from django.template.loader import render_to_string
from aircox.conf import settings
from ..conf import settings
from ..connector import Connector
from .sources import PlaylistSource, QueueSource
@ -46,8 +45,8 @@ class Streamer:
self.outputs = self.station.port_set.active().output()
self.id = self.station.slug.replace("-", "_")
self.path = os.path.join(station.path, "station.liq")
self.connector = connector or Connector(os.path.join(station.path, "station.sock"))
self.path = settings.get_dir(station, "station.liq")
self.connector = connector or Connector(settings.get_dir(station, "station.sock"))
self.init_sources()
@property
@ -96,9 +95,10 @@ class Streamer:
data = render_to_string(
self.template_name,
{
"dir": settings.get_dir(self.station),
"log_file": settings.get_dir(self.station, "liquidsoap.log"),
"station": self.station,
"streamer": self,
"settings": settings,
},
)
data = re.sub("[\t ]+\n", "\n", data)