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

Storage of playlog entry.

parent 413370a8
No related branches found
No related tags found
No related merge requests found
......@@ -44,31 +44,30 @@ class PlayLog(db.Model):
track_title = Column(String(256))
track_duration = Column(String(256))
track_type = Column(Integer)
schedule_id = Column(Integer)
schedule_start = Column(DateTime)
schedule_end = Column(DateTime)
schedule_repetition = Column(Boolean)
schedule_playlist_id = Column(Integer)
schedule_fallback_type = Column(Integer)
show_id = Column(Integer)
schedule_repetition = Column(Boolean)
schedule_playlist_id = Column(Integer)
schedule_fallback_type = Column(Integer)
show_id = Column(Integer)
timeslot_id = Column(Integer)
show_name = Column(String(256))
show_funding_category = Column(String(256))
show_name = Column(String(256))
show_type = Column(String(256))
show_category = Column(String(256))
show_topic = Column(String(256))
log_source = Column(Integer)
def __init__(self):
def __init__(self, data):
"""
Initializes a trackservice entry
"""
pass
self.track_start = data.track_start
self.track_artist = data.track_artist
self.track_album = data.track_album
self.track_title = data.track_title
self.track_duration = data.track_duration
self.track_type = data.track_type
self.timeslot_id = data.timeslot_id
self.show_name = data.show_name
self.log_source = data.log_source
def save(self):
db.session.add(self)
db.session.commit()
@staticmethod
......
......@@ -83,13 +83,15 @@ class ApiService():
return tracklist_schema.dump(tracklist)
def store_playlog():
def store_playlog(self, data):
"""
Stores the passed playlog entry.
Returns:
(PlayLogEntry)
"""
playlog = PlayLog(data)
playlog.save()
def clock_info(self):
......
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