mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-03 14:50:49 +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() {
|
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…
Add table
Add a link
Reference in a new issue