Improve checks for audio in stayed state

This commit is contained in:
Manuel Cortez 2019-04-22 00:10:40 -05:00
parent 20f0b3f782
commit eec5350926

View File

@ -63,7 +63,7 @@ class audioPlayer(object):
if "url" in object and object["url"] =="": if "url" in object and object["url"] =="":
pub.sendMessage("notify", message=_("This file could not be played because it is not allowed in your country")) pub.sendMessage("notify", message=_("This file could not be played because it is not allowed in your country"))
return return
if self.stream != None and self.stream.is_playing == True: if self.stream != None and (self.stream.is_playing == True or self.stream.is_stayed == True):
try: try:
self.stream.stop() self.stream.stop()
except BassError: except BassError:
@ -196,7 +196,7 @@ class audioPlayer(object):
""" check if the player is already playing a stream. """ """ check if the player is already playing a stream. """
if self.stream == None: if self.stream == None:
return False return False
if self.stream != None and self.stream.is_playing == False: if self.stream != None and self.stream.is_playing == False and self.stream.is_stayed == False:
return False return False
else: else:
return True return True