Commit 383a074d authored by David Trattnig's avatar David Trattnig
Browse files

Avoid hybrid property due threading issues.

parent a5939f88
......@@ -245,19 +245,19 @@ class SoundSystem():
is_ready = False
# LIVE
if entry.type == ChannelType.LIVE:
if entry.get_type() == ChannelType.LIVE:
entry.channel = "linein_" + entry.source.split("line://")[1]
is_ready = True
else:
# Choose and save the input channel
entry.previous_channel, entry.channel = self.channel_swap(entry.type)
entry.previous_channel, entry.channel = self.channel_swap(entry.get_type())
# PLAYLIST
if entry.type == ChannelType.FILESYSTEM:
if entry.get_type() == ChannelType.FILESYSTEM:
is_ready = self.playlist_push(entry.channel, entry.source)
# STREAM
elif entry.type == ChannelType.HTTP or entry.type == ChannelType.HTTPS:
elif entry.get_type() == ChannelType.HTTP or entry.get_type() == ChannelType.HTTPS:
is_ready = self.stream_load_entry(entry)
if is_ready == True:
......@@ -286,11 +286,11 @@ class SoundSystem():
# Validate entry type
for entry in entries:
if entry.type != ChannelType.FILESYSTEM:
if entry.get_type() != ChannelType.FILESYSTEM:
raise InvalidChannelException
# Determine channel
channel = self.channel_swap(entry.type)
channel = self.channel_swap(entry.get_type())
# Queue entries
for entry in entries:
......@@ -336,7 +336,7 @@ class SoundSystem():
self.disable_transaction()
# Update active channel and type
self.active_channel[entry.type] = entry.channel
self.active_channel[entry.get_type()] = entry.channel
# Dear filesystem channels, please leave the room as you would like to find it!
if entry.previous_channel and entry.previous_channel in ChannelType.FILESYSTEM.channels:
......
......@@ -247,7 +247,7 @@ class Schedule(DB.Model, AuraDatabaseModel):
"show": {
"name": self.show_name,
"type": self.type,
"type": self.get_type(),
"host": self.show_hosts
},
......@@ -451,8 +451,7 @@ class PlaylistEntry(DB.Model, AuraDatabaseModel):
def volume(self):
return 100 # FIXME Make DB Column
@hybrid_property
def type(self):
def get_type(self):
return EngineUtil.get_channel_type(self.uri)
......
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