Avoid app crashing after station change
This commit is contained in:
parent
9c417d7620
commit
d707588926
@ -108,7 +108,12 @@ class MainWindow(QMainWindow):
|
||||
stream_url = f"http://stream.open.fm/{e['id']}"
|
||||
|
||||
self.__player.setSource(QUrl(stream_url))
|
||||
self.togglePlayer()
|
||||
|
||||
# Required to avoid crashing. For some reason if you want to change
|
||||
# the station for the first time, you need to stop and resume playback.
|
||||
# If you won't, application would crash.
|
||||
for _ in range(3):
|
||||
self.togglePlayer()
|
||||
|
||||
def togglePlayer(self) -> None:
|
||||
"""Toggle playback (play/stop)."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user