Skip to content
Snippets Groups Projects
Commit b76a28df authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Remove unused json_timeslots_specials function

parent eb3d3835
No related branches found
No related tags found
No related merge requests found
...@@ -147,32 +147,6 @@ def json_playout(request): ...@@ -147,32 +147,6 @@ def json_playout(request):
content_type="application/json; charset=utf-8") content_type="application/json; charset=utf-8")
def json_timeslots_specials(request):
specials = {}
shows = get_cached_shows()['shows']
for show in shows:
show['pv_id'] = -1
if show['type'] == 's':
specials[show['id']] = show
for ts in TimeSlot.objects.filter(end__gt=timezone.now(),
schedule__automation_id__in=specials.keys()).select_related('show'):
automation_id = ts.schedule.automation_id
start = ts.start.strftime('%Y-%m-%d_%H:%M:%S')
end = ts.end.strftime('%Y-%m-%d_%H:%M:%S')
if specials[automation_id]['pv_id'] != -1:
if specials[automation_id]['pv_start'] < start:
continue
specials[automation_id]['pv_id'] = ts.show.id
specials[automation_id]['pv_name'] = ts.show.name
specials[automation_id]['pv_start'] = start
specials[automation_id]['pv_end'] = end
return HttpResponse(json.dumps(specials, ensure_ascii=False).encode('utf8'),
content_type="application/json; charset=utf-8")
def int_or_none(key, kwargs): def int_or_none(key, kwargs):
return int(kwargs[key]) if key in kwargs else None return int(kwargs[key]) if key in kwargs else None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment