forked from rc/aircox
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:
@ -133,8 +133,10 @@ class Monitor:
|
||||
# get sound
|
||||
diff = None
|
||||
sound = Sound.objects.path(air_uri).first()
|
||||
if sound and sound.episode_id is not None:
|
||||
diff = Diffusion.objects.episode(id=sound.episode_id).on_air().now(air_time).first()
|
||||
if sound:
|
||||
ids = sound.episodesound_set.values_list("episode_id", flat=True)
|
||||
if ids:
|
||||
diff = Diffusion.objects.filter(episode_id__in=ids).on_air().now(air_time).first()
|
||||
|
||||
# log sound on air
|
||||
return self.log(
|
||||
@ -198,7 +200,7 @@ class Monitor:
|
||||
Diffusion.objects.station(self.station)
|
||||
.on_air()
|
||||
.now(now)
|
||||
.filter(episode__sound__type=Sound.TYPE_ARCHIVE)
|
||||
.filter(episode__episodesound__broadcast=True)
|
||||
.first()
|
||||
)
|
||||
# Can't use delay: diffusion may start later than its assigned start.
|
||||
@ -227,7 +229,7 @@ class Monitor:
|
||||
return log
|
||||
|
||||
def start_diff(self, source, diff):
|
||||
playlist = Sound.objects.episode(id=diff.episode_id).playlist()
|
||||
playlist = diff.episode.episodesound_set.all().broadcast().playlist()
|
||||
source.push(*playlist)
|
||||
self.log(
|
||||
type=Log.TYPE_START,
|
||||
|
Reference in New Issue
Block a user