Skip to content

Commit 1201dd4

Browse files
show actual current playing program
1 parent 8e62062 commit 1201dd4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

rootio/radio/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ def scheduled_programs(self):
195195

196196
def current_program(self):
197197
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)
198+
programs = ScheduledProgram.contains(now).filter_by(station_id=self.id).order_by(
199+
ScheduledProgram.end.asc())
199200
# TODO, how to resolve overlaps?
200201
return programs.first()
201202

0 commit comments

Comments
 (0)