Glimpse: Flow content provides flows on IO dispatcher
Change-Id: Idfa0bc09dda0eb71835c1b8d3c9572b5a757bb43
This commit is contained in:
parent
3107835489
commit
1baef233ff
|
@ -6,13 +6,15 @@
|
|||
package org.lineageos.glimpse.repository
|
||||
|
||||
import android.content.Context
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.flowOn
|
||||
import org.lineageos.glimpse.flow.AlbumsFlow
|
||||
import org.lineageos.glimpse.flow.MediaFlow
|
||||
|
||||
@Suppress("Unused")
|
||||
class MediaRepository(private val context: Context) {
|
||||
fun media(bucketId: Int? = null) = MediaFlow(context, bucketId).flowData()
|
||||
fun mediaCursor(bucketId: Int? = null) = MediaFlow(context, bucketId).flowCursor()
|
||||
fun albums() = AlbumsFlow(context).flowData()
|
||||
fun albumsCursor() = AlbumsFlow(context).flowCursor()
|
||||
fun media(bucketId: Int? = null) = MediaFlow(context, bucketId).flowData().flowOn(Dispatchers.IO)
|
||||
fun mediaCursor(bucketId: Int? = null) = MediaFlow(context, bucketId).flowCursor().flowOn(Dispatchers.IO)
|
||||
fun albums() = AlbumsFlow(context).flowData().flowOn(Dispatchers.IO)
|
||||
fun albumsCursor() = AlbumsFlow(context).flowCursor().flowOn(Dispatchers.IO)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue