mirror of
https://github.com/oxyroid/M3UAndroid.git
synced 2025-05-18 11:56:24 +08:00
fix: coroutine-dispatcher.
This commit is contained in:
@ -720,4 +720,3 @@ private enum class MaskNavigateRole {
|
||||
}
|
||||
|
||||
data class CwPosition(val milliseconds: Long)
|
||||
data object Slide
|
@ -47,7 +47,6 @@ import com.m3u.data.worker.SubscriptionWorker
|
||||
import com.m3u.business.playlist.PlaylistMessage.ChannelCoverSaved
|
||||
import com.m3u.core.wrapper.Sort
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.CoroutineDispatcher
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@ -261,7 +260,6 @@ class PlaylistViewModel @Inject constructor(
|
||||
flow.drop(1).debounce(1.seconds)
|
||||
)
|
||||
}
|
||||
.flowOn(ioDispatcher)
|
||||
.stateIn(
|
||||
scope = viewModelScope,
|
||||
initialValue = emptyList(),
|
||||
@ -315,7 +313,6 @@ class PlaylistViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
.flowOn(ioDispatcher)
|
||||
.stateIn(
|
||||
scope = viewModelScope,
|
||||
initialValue = emptyList(),
|
||||
@ -324,7 +321,6 @@ class PlaylistViewModel @Inject constructor(
|
||||
|
||||
val pinnedCategories: StateFlow<List<String>> = playlist
|
||||
.map { it?.pinnedCategories ?: emptyList() }
|
||||
.flowOn(ioDispatcher)
|
||||
.stateIn(
|
||||
scope = viewModelScope,
|
||||
initialValue = emptyList(),
|
||||
|
@ -552,6 +552,7 @@ internal class PlaylistRepositoryImpl @Inject constructor(
|
||||
.sortedByDescending { it in pinnedCategories }
|
||||
}
|
||||
}
|
||||
.flowOn(Dispatchers.Default)
|
||||
|
||||
override suspend fun unsubscribe(url: String): Playlist? = logger.execute {
|
||||
val playlist = playlistDao.get(url)
|
||||
|
Reference in New Issue
Block a user