Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Oct 16, 2024
1 parent 25134be commit 2f67ae9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ internal actual val platformModule: Module =
SMBJHandler
}
single<SqlDriver> { DriverFactory(context = get()).createDriver() }
single<NetworkHandler> {
SMBJHandler
}
single<SqlDriver> { DriverFactory(context = get()).createDriver() }
single<CacheInterface> {
val context: Context = get()
SharedFileCache(context.cacheDir.path)
}
}
single<NetworkHandler> {
SMBJHandler
}
single<SqlDriver> { DriverFactory(context = get()).createDriver() }
single<CacheInterface> {
val context:Context = get()
SharedFileCache(context.cacheDir.path)
}
}

@OptIn(KoinInternalApi::class)
fun KoinApplication.androidContext(androidContext: Context): KoinApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ import coil3.fetch.FetchResult
import coil3.fetch.ImageFetchResult

actual open class SharedImage actual constructor(actual val byteArray: ByteArray) {

actual fun getFetchResult(size: Int): FetchResult? {
val image: Image? = getAndroidBitmap(byteArray, size)?.asImage()
return if (image != null) ImageFetchResult(
image = image,
isSampled = true,
dataSource = DataSource.NETWORK,
)
else null
return if (image != null) {
ImageFetchResult(
image = image,
isSampled = true,
dataSource = DataSource.NETWORK,
)
} else {
null
}
}

private fun getCoilImage(size: Int): Image? = getAndroidBitmap(byteArray, size)?.asImage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class CachedImageDataSource(
private val cache: CacheInterface,
private val logger: Logger,
driver: SqlDriver,
private val logger: Logger,
) {
private val database = PlaylistDatabase(driver)

Expand All @@ -28,7 +27,7 @@ class CachedImageDataSource(
}
}

fun saveImage(
suspend fun saveImage(
directory: NetworkDirectoryDetails,
image: SharedImage,
) {
Expand Down

0 comments on commit 2f67ae9

Please sign in to comment.