musikr: reformat

This commit is contained in:
Alexander Capehart 2025-03-03 20:47:51 -07:00
parent 387a36a3f8
commit 1fc9ca5147
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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)
} }
} }