Commit 6b0c4d64 authored by David Trattnig's avatar David Trattnig
Browse files

Add state attributes.

parent ee2a6f6c
......@@ -423,7 +423,7 @@ class PlaylistEntry(DB.Model, AuraDatabaseModel):
entry_start = Column(DateTime)
queue_state = None # Assigned when entry is about to be queued
channel = None # Assigned when entry is actually played
state = None # Assigned when state changes
# relationships
playlist = relationship("Playlist", uselist=False, back_populates="entries")
......@@ -718,6 +718,10 @@ class SingleEntry(DB.Model, AuraDatabaseModel):
source = Column(String(1024))
entry_start = Column(DateTime)
queue_state = None # Assigned when entry is about to be queued
channel = None # Assigned when entry is actually played
state = None # Assigned when state changes
@hybrid_property
def entry_end(self):
......@@ -739,19 +743,6 @@ class SingleEntry(DB.Model, AuraDatabaseModel):
def type(self):
return EngineUtil.get_channel_type(self.uri)
@hybrid_property
def channel(self):
type = EngineUtil.get_channel_type(self.uri)
if type == ChannelType.FILESYSTEM:
return Channel.FILESYSTEM_A
elif type == ChannelType.HTTP:
return Channel.HTTP_A
elif type == ChannelType.HTTPS:
return Channel.HTTPS_A
else:
return "foo:bar"
#FIXME Extend & finalize!!
def as_dict(self):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment