now = datetime.now()
# get program of today minus a few hours, as radio days are not from
# midnight to midnigth but from 5am to 5am
- program = day_program(now - timedelta(hours=Schedule.DAY_HOUR_START),
+ program = day_program(now - timedelta(hours=Schedule.DAY_HOUR_START) + timedelta(minutes=Schedule.DAY_MINUTE_START),
prefetch_sounds=False, prefetch_categories=False, include_nonstop=False)
program = [x for x in program if not x.datetime > now]
# last step is adding nonstop zones between slots
nonstops = list(Nonstop.objects.all().order_by('start'))
nonstops = [x for x in nonstops if x.start != x.end]
- dawn = time(Schedule.DAY_HOUR_START, 0)
+ dawn = time(Schedule.DAY_HOUR_START, Schedule.DAY_MINUTE_START)
try:
first_of_the_day = [x for x in nonstops if x.start <= dawn][-1]
nonstops = nonstops[nonstops.index(first_of_the_day):] + nonstops[:nonstops.index(first_of_the_day)]