We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e62062 commit 1201dd4Copy full SHA for 1201dd4
1 file changed
rootio/radio/models.py
@@ -195,7 +195,8 @@ def scheduled_programs(self):
195
196
def current_program(self):
197
now = datetime.now(pytz.timezone(self.timezone)).strftime('%Y-%m-%d %H:%M:%S')
198
- programs = ScheduledProgram.contains(now).filter_by(station_id=self.id)
+ programs = ScheduledProgram.contains(now).filter_by(station_id=self.id).order_by(
199
+ ScheduledProgram.end.asc())
200
# TODO, how to resolve overlaps?
201
return programs.first()
202
0 commit comments