Revert streaming on/off procedures changes.

This commit is contained in:
Pecusx
2017-05-07 21:18:23 +02:00
committed by GitHub
parent 44614544f0
commit bbe52b4cf6
+16 -18
View File
@@ -449,7 +449,6 @@ class Radio:
# Icecast Streaming settings # Icecast Streaming settings
self.streaming = self.getStoredStreaming() self.streaming = self.getStoredStreaming()
if self.streaming: if self.streaming:
self.streaming = False
self.streamingOn() self.streamingOn()
else: else:
self.streamingOff() self.streamingOff()
@@ -1401,27 +1400,26 @@ class Radio:
# Switch on Icecast2 streaming # Switch on Icecast2 streaming
def streamingOn(self): def streamingOn(self):
if not self.streaming: output_id = 2
output_id = 2 self.streaming = True
self.streaming = True self.execCommand("service icecast2 start")
self.execCommand("service icecast2 start") self.execCommand("service darkice start")
self.execCommand("service darkice start") self.execMpcCommand("enable " + str(output_id))
self.execMpcCommand("enable " + str(output_id)) self.storeStreaming("on")
self.storeStreaming("on") self.streamingStatus()
self.streamingStatus() self.streammetadata = ''
return self.streaming return self.streaming
# Switch off Icecast2 streaming # Switch off Icecast2 streaming
def streamingOff(self): def streamingOff(self):
if self.streaming: output_id = 2
output_id = 2 self.streaming = False
self.streaming = False self.execMpcCommand("disable " + str(output_id))
self.execMpcCommand("disable " + str(output_id)) self.execCommand("service darkice stop")
self.execCommand("service darkice stop") self.execCommand("service icecast2 stop")
self.execCommand("service icecast2 stop") self.storeStreaming("off")
self.storeStreaming("off") self.streamingStatus()
self.streamingStatus() self.streammetadata = ''
self.streammetadata = ''
return self.streaming return self.streaming
# Display streaming status # Display streaming status