Skip to content
Snippets Groups Projects
Commit 1610c30c authored by David Trattnig's avatar David Trattnig
Browse files

Match duration for current track. #6

parent ad95688f
No related branches found
No related tags found
No related merge requests found
...@@ -96,7 +96,11 @@ class PlayLog(db.Model): ...@@ -96,7 +96,11 @@ class PlayLog(db.Model):
track = db.session.query(PlayLog).\ track = db.session.query(PlayLog).\
filter(PlayLog.track_start <= str(now)).\ filter(PlayLog.track_start <= str(now)).\
order_by(PlayLog.track_start.desc()).first() order_by(PlayLog.track_start.desc()).first()
return track
if track.track_start + datetime.timedelta(0,track.track_duration) < now:
return None
else:
return track
@staticmethod @staticmethod
......
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