class OnAir(View):
def get_infos(self, ctx):
infos = {}
+ include_track_metadata = settings.ONAIR_ALWAYS_INCLUDE_TRACK_METADATA
+
if ctx.get('episode'):
infos['episode'] = {
'title': ctx['episode'].title,
'subtitle': ctx['episode'].subtitle,
'url': ctx['episode'].get_absolute_url(),
}
+
if ctx.get('emission'):
chat_url = None
if ctx['emission'].chat_open:
'url': ctx['emission'].get_absolute_url(),
'chat': chat_url,
}
+ if ctx['current_slot'].recurringplaylistdiffusion_set.exists():
+ include_track_metadata = True
+
if ctx.get('nonstop'):
+ include_track_metadata = True
redirect_path = ctx['nonstop'].redirect_path
infos['nonstop'] = {
'title': ctx['nonstop'].get_public_label(),
'slug': ctx['current_slot'].slug,
},
)
- if ctx.get('nonstop') or settings.ONAIR_ALWAYS_INCLUDE_TRACK_METADATA:
+
+ if include_track_metadata:
infos.update(get_current_nonstop_track())
+
return infos
def get(self, request, *args, **kwargs):