fix error in streamer and on_air

This commit is contained in:
bkfox
2017-07-02 18:09:40 +02:00
parent 013a0894ab
commit 08cb8e71bb
5 changed files with 108 additions and 52 deletions

View File

@ -37,14 +37,17 @@ def on_air(request):
station = request.GET.get('station');
if station:
station = stations.stations.filter(name = station)
if not station.count():
return HttpResponse('')
else:
station = stations.stations.first()
station = stations.stations
station = station.first()
on_air = station.on_air(count = 10).select_related('track','diffusion')
if not on_air.count():
return HttpResponse('')
last = on_air.last()
last = on_air.first()
if last.track:
last = {
'type': 'track',