mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
avoid too many "disconnected" signals
This commit is contained in:
parent
6ed7a9c46d
commit
23f9ffa76c
@ -706,7 +706,6 @@ class Client(MPDClient):
|
|||||||
return [Song(song) for song in super().listplaylistinfo(name)]
|
return [Song(song) for song in super().listplaylistinfo(name)]
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self.emitter.emit("disconnected") # bring player in defined state
|
|
||||||
profile=self._settings.get_active_profile()
|
profile=self._settings.get_active_profile()
|
||||||
if profile.get_boolean("socket-connection"):
|
if profile.get_boolean("socket-connection"):
|
||||||
socket=profile.get_string("socket")
|
socket=profile.get_string("socket")
|
||||||
@ -720,6 +719,7 @@ class Client(MPDClient):
|
|||||||
if profile.get_string("password"):
|
if profile.get_string("password"):
|
||||||
self.password(profile.get_string("password"))
|
self.password(profile.get_string("password"))
|
||||||
except:
|
except:
|
||||||
|
self.emitter.emit("disconnected")
|
||||||
self.emitter.emit("connection_error")
|
self.emitter.emit("connection_error")
|
||||||
return False
|
return False
|
||||||
# connect successful
|
# connect successful
|
||||||
@ -735,6 +735,7 @@ class Client(MPDClient):
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
self.emitter.emit("disconnected")
|
||||||
self.emitter.emit("connection_error")
|
self.emitter.emit("connection_error")
|
||||||
print("No read permission, check your mpd config.")
|
print("No read permission, check your mpd config.")
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user