mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-05-29 04:50:19 +02:00
fix: Services should not crash if already started
This commit is contained in:
parent
333f00235b
commit
f938f79a35
@ -37,7 +37,10 @@ class ServiceDiscoverer(names: Array<String>, private val _onServicesUpdated: (L
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun start() {
|
fun start() {
|
||||||
if (_started) throw Exception("Already running.")
|
if (_started) {
|
||||||
|
Logger.i(TAG, "Already started.")
|
||||||
|
return
|
||||||
|
}
|
||||||
_started = true
|
_started = true
|
||||||
|
|
||||||
val listener = MDNSListener()
|
val listener = MDNSListener()
|
||||||
|
@ -66,6 +66,10 @@ class StateSync {
|
|||||||
val deviceUpdatedOrAdded: Event2<String, SyncSession> = Event2()
|
val deviceUpdatedOrAdded: Event2<String, SyncSession> = Event2()
|
||||||
|
|
||||||
fun start() {
|
fun start() {
|
||||||
|
if (_started) {
|
||||||
|
Logger.i(TAG, "Already started.")
|
||||||
|
return
|
||||||
|
}
|
||||||
_started = true
|
_started = true
|
||||||
|
|
||||||
if (Settings.instance.synchronization.broadcast || Settings.instance.synchronization.connectDiscovered) {
|
if (Settings.instance.synchronization.broadcast || Settings.instance.synchronization.connectDiscovered) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user