all: reformat
This commit is contained in:
parent
9a38877c2e
commit
001db620e3
5 changed files with 10 additions and 19 deletions
|
@ -25,8 +25,8 @@ import dagger.Provides
|
|||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import org.oxycblt.musikr.cache.Cache
|
||||
import javax.inject.Singleton
|
||||
import org.oxycblt.musikr.cache.Cache
|
||||
import org.oxycblt.musikr.playlist.db.StoredPlaylists
|
||||
|
||||
@Module
|
||||
|
@ -40,9 +40,7 @@ interface MusicModule {
|
|||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
class MusikrShimModule {
|
||||
@Singleton
|
||||
@Provides
|
||||
fun cache(@ApplicationContext context: Context) = Cache.from(context)
|
||||
@Singleton @Provides fun cache(@ApplicationContext context: Context) = Cache.from(context)
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
|
|
|
@ -367,10 +367,7 @@ constructor(
|
|||
if (withCache) {
|
||||
revision = musicSettings.revision
|
||||
storage =
|
||||
Storage(
|
||||
cache,
|
||||
MutableRevisionedStoredCovers(context, revision),
|
||||
storedPlaylists)
|
||||
Storage(cache, MutableRevisionedStoredCovers(context, revision), storedPlaylists)
|
||||
} else {
|
||||
revision = UUID.randomUUID()
|
||||
storage =
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.oxycblt.auxio.music
|
||||
|
||||
import android.content.Context
|
||||
import androidx.media3.common.util.Log
|
||||
import java.util.UUID
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
import org.oxycblt.musikr.cover.Cover
|
||||
|
@ -29,7 +28,8 @@ import org.oxycblt.musikr.cover.StoredCovers
|
|||
|
||||
open class RevisionedStoredCovers(private val context: Context, private val revision: UUID?) :
|
||||
StoredCovers {
|
||||
protected val inner = revision?.let { StoredCovers.from(context, "covers_$it", CoverFormat.jpeg()) }
|
||||
protected val inner =
|
||||
revision?.let { StoredCovers.from(context, "covers_$it", CoverFormat.jpeg()) }
|
||||
|
||||
override suspend fun obtain(id: String): RevisionedCover? {
|
||||
val split = id.split('@', limit = 2)
|
||||
|
@ -43,7 +43,8 @@ open class RevisionedStoredCovers(private val context: Context, private val revi
|
|||
val storedCovers = unlikelyToBeNull(inner)
|
||||
return storedCovers.obtain(coverId)?.let { RevisionedCover(revision, it) }
|
||||
} else {
|
||||
val storedCovers = StoredCovers.from(context, "covers_$coverRevision", CoverFormat.jpeg())
|
||||
val storedCovers =
|
||||
StoredCovers.from(context, "covers_$coverRevision", CoverFormat.jpeg())
|
||||
return storedCovers.obtain(coverId)?.let { RevisionedCover(coverRevision, it) }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,9 +50,7 @@ private class CacheImpl(private val cacheInfoDao: CacheInfoDao) : Cache() {
|
|||
}
|
||||
|
||||
class WriteOnlyCache(private val inner: Cache) : Cache() {
|
||||
override suspend fun read(file: DeviceFile, storedCovers: StoredCovers) =
|
||||
CacheResult.Miss(file)
|
||||
override suspend fun read(file: DeviceFile, storedCovers: StoredCovers) = CacheResult.Miss(file)
|
||||
|
||||
override suspend fun write(song: RawSong) =
|
||||
inner.write(song)
|
||||
override suspend fun write(song: RawSong) = inner.write(song)
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
package org.oxycblt.musikr.pipeline
|
||||
|
||||
import android.util.Log
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
@ -79,9 +78,7 @@ private class EvaluateStepImpl(
|
|||
val graphBuild =
|
||||
merge(
|
||||
filterFlow.manager,
|
||||
preSongs.onEach {
|
||||
wrap(it, graphBuilder::add)
|
||||
},
|
||||
preSongs.onEach { wrap(it, graphBuilder::add) },
|
||||
prePlaylists.onEach { wrap(it, graphBuilder::add) })
|
||||
graphBuild.collect()
|
||||
val graph = graphBuilder.build()
|
||||
|
|
Loading…
Reference in a new issue