mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-22 20:33:05 +00:00
ktlint format
This commit is contained in:
parent
03fee6e8df
commit
59a9538559
3 changed files with 10 additions and 11 deletions
|
@ -19,11 +19,11 @@ import de.nicidienase.chaosflix.common.userdata.entities.watchlist.WatchlistItem
|
|||
import de.nicidienase.chaosflix.common.util.LiveEvent
|
||||
import de.nicidienase.chaosflix.common.util.SingleLiveEvent
|
||||
import de.nicidienase.chaosflix.touch.browse.cast.CastService
|
||||
import java.io.File
|
||||
import java.util.ArrayList
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
import java.util.ArrayList
|
||||
|
||||
class DetailsViewModel(
|
||||
private val database: ChaosflixDatabase,
|
||||
|
|
|
@ -17,15 +17,17 @@ import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl
|
|||
import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress
|
||||
import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgressDao
|
||||
import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem
|
||||
import java.util.Date
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import pl.droidsonroids.casty.Casty
|
||||
import pl.droidsonroids.casty.MediaData
|
||||
import java.util.Date
|
||||
|
||||
class CastService(private val playbackProgressDao: PlaybackProgressDao,
|
||||
private val scope: CoroutineScope) : LifecycleObserver {
|
||||
class CastService(
|
||||
private val playbackProgressDao: PlaybackProgressDao,
|
||||
private val scope: CoroutineScope
|
||||
) : LifecycleObserver {
|
||||
|
||||
private var currentEvent: Event? = null
|
||||
|
||||
|
@ -107,8 +109,9 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao,
|
|||
}
|
||||
|
||||
private inner class SessionListener(
|
||||
private val guid: String,
|
||||
progress: PlaybackProgress?): SessionManagerListener<CastSession> {
|
||||
private val guid: String,
|
||||
progress: PlaybackProgress?
|
||||
) : SessionManagerListener<CastSession> {
|
||||
|
||||
private lateinit var playbackProgress: PlaybackProgress
|
||||
init {
|
||||
|
@ -123,7 +126,6 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao,
|
|||
progress.apply { this.id = id }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +147,6 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao,
|
|||
castSession.remoteMediaClient?.addProgressListener(progressListener, 5000)
|
||||
}
|
||||
|
||||
|
||||
override fun onSessionStarted(p0: CastSession?, p1: String?) {
|
||||
Log.d(TAG, "onSessionStarted")
|
||||
p0?.let { attachProgressListener(it) }
|
||||
|
@ -176,7 +177,6 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao,
|
|||
|
||||
override fun onSessionStartFailed(p0: CastSession?, p1: Int) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -71,7 +71,6 @@ class NavigationActivity : AppCompatActivity() {
|
|||
override fun onStart() {
|
||||
super.onStart()
|
||||
viewModel.attachActivityToCastService(this)
|
||||
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
|
|
Loading…
Reference in a new issue