mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
fix: Services should not crash if already started
This commit is contained in:
parent
333f00235b
commit
f938f79a35
2 changed files with 8 additions and 1 deletions
|
@ -37,7 +37,10 @@ class ServiceDiscoverer(names: Array<String>, private val _onServicesUpdated: (L
|
|||
}
|
||||
|
||||
fun start() {
|
||||
if (_started) throw Exception("Already running.")
|
||||
if (_started) {
|
||||
Logger.i(TAG, "Already started.")
|
||||
return
|
||||
}
|
||||
_started = true
|
||||
|
||||
val listener = MDNSListener()
|
||||
|
|
|
@ -66,6 +66,10 @@ class StateSync {
|
|||
val deviceUpdatedOrAdded: Event2<String, SyncSession> = Event2()
|
||||
|
||||
fun start() {
|
||||
if (_started) {
|
||||
Logger.i(TAG, "Already started.")
|
||||
return
|
||||
}
|
||||
_started = true
|
||||
|
||||
if (Settings.instance.synchronization.broadcast || Settings.instance.synchronization.connectDiscovered) {
|
||||
|
|
Loading…
Add table
Reference in a new issue