musikr: reformat
This commit is contained in:
parent
387a36a3f8
commit
1fc9ca5147
2 changed files with 8 additions and 3 deletions
|
@ -34,12 +34,16 @@ internal interface DeviceFiles {
|
||||||
fun explore(locations: Flow<MusicLocation>): Flow<DeviceNode>
|
fun explore(locations: Flow<MusicLocation>): Flow<DeviceNode>
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun from(context: Context, ignoreHidden: Boolean): DeviceFiles = DeviceFilesImpl(context.contentResolverSafe, ignoreHidden)
|
fun from(context: Context, ignoreHidden: Boolean): DeviceFiles =
|
||||||
|
DeviceFilesImpl(context.contentResolverSafe, ignoreHidden)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
private class DeviceFilesImpl(private val contentResolver: ContentResolver, private val ignoreHidden: Boolean) : DeviceFiles {
|
private class DeviceFilesImpl(
|
||||||
|
private val contentResolver: ContentResolver,
|
||||||
|
private val ignoreHidden: Boolean
|
||||||
|
) : DeviceFiles {
|
||||||
override fun explore(locations: Flow<MusicLocation>): Flow<DeviceNode> =
|
override fun explore(locations: Flow<MusicLocation>): Flow<DeviceNode> =
|
||||||
locations.flatMapMerge { location ->
|
locations.flatMapMerge { location ->
|
||||||
// Create a root directory for each location
|
// Create a root directory for each location
|
||||||
|
|
|
@ -46,7 +46,8 @@ internal interface ExploreStep {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun from(context: Context, storage: Storage, interpretation: Interpretation): ExploreStep =
|
fun from(context: Context, storage: Storage, interpretation: Interpretation): ExploreStep =
|
||||||
ExploreStepImpl(DeviceFiles.from(context, interpretation.ignoreHidden), storage.storedPlaylists)
|
ExploreStepImpl(
|
||||||
|
DeviceFiles.from(context, interpretation.ignoreHidden), storage.storedPlaylists)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue