diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/AccountInteractor.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/AccountInteractor.kt index b9d057e76..885587535 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/AccountInteractor.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/AccountInteractor.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.interactor import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.typealiases.AccountId interface AccountInteractor { diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ImageInteractor.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ImageInteractor.kt index 54b83673e..5f10aab37 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ImageInteractor.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ImageInteractor.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.interactor import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo import org.michaelbel.movies.persistence.database.typealiases.MovieId interface ImageInteractor { diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/MovieInteractor.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/MovieInteractor.kt index f0aec73c7..92fbf9956 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/MovieInteractor.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/MovieInteractor.kt @@ -4,7 +4,7 @@ import androidx.paging.PagingData import androidx.paging.PagingSource import kotlinx.coroutines.flow.Flow import org.michaelbel.movies.common.list.MovieList -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini import org.michaelbel.movies.persistence.database.typealiases.Limit import org.michaelbel.movies.persistence.database.typealiases.MovieId diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SuggestionInteractor.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SuggestionInteractor.kt index f15c9dc7d..a7d030f0d 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SuggestionInteractor.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/SuggestionInteractor.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.interactor import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo interface SuggestionInteractor { diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/AccountInteractorImpl.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/AccountInteractorImpl.kt index 1ac4f2dfb..57080c5d3 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/AccountInteractorImpl.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/AccountInteractorImpl.kt @@ -4,7 +4,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.withContext import org.michaelbel.movies.common.dispatchers.MoviesDispatchers import org.michaelbel.movies.interactor.AccountInteractor -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.typealiases.AccountId import org.michaelbel.movies.repository.AccountRepository diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/ImageInteractorImpl.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/ImageInteractorImpl.kt index 09426d223..c730e6685 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/ImageInteractorImpl.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/ImageInteractorImpl.kt @@ -4,7 +4,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.withContext import org.michaelbel.movies.common.dispatchers.MoviesDispatchers import org.michaelbel.movies.interactor.ImageInteractor -import org.michaelbel.movies.persistence.database.entity.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.repository.ImageRepository diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/MovieInteractorImpl.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/MovieInteractorImpl.kt index 44aaf9f9d..4eee71f0e 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/MovieInteractorImpl.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/MovieInteractorImpl.kt @@ -18,7 +18,7 @@ import org.michaelbel.movies.interactor.remote.FeedMoviesRemoteMediator import org.michaelbel.movies.interactor.remote.SearchMoviesRemoteMediator import org.michaelbel.movies.network.model.MovieResponse import org.michaelbel.movies.persistence.database.MoviesDatabase -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini import org.michaelbel.movies.persistence.database.typealiases.Limit import org.michaelbel.movies.persistence.database.typealiases.MovieId diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/SuggestionInteractorImpl.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/SuggestionInteractorImpl.kt index 54fbf4862..2add50081 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/SuggestionInteractorImpl.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/impl/SuggestionInteractorImpl.kt @@ -5,7 +5,7 @@ import kotlinx.coroutines.withContext import org.michaelbel.movies.common.dispatchers.MoviesDispatchers import org.michaelbel.movies.interactor.LocaleInteractor import org.michaelbel.movies.interactor.SuggestionInteractor -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo import org.michaelbel.movies.repository.SuggestionRepository internal class SuggestionInteractorImpl( diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ktx/MovieListKtx.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ktx/MovieListKtx.kt index 45c0b8c0e..80794b6f7 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ktx/MovieListKtx.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/ktx/MovieListKtx.kt @@ -2,7 +2,7 @@ package org.michaelbel.movies.interactor.ktx import org.michaelbel.movies.common.list.MovieList import org.michaelbel.movies.network.config.isTmdbApiKeyEmpty -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo val MovieList.nameOrLocalList: String get() = if (isTmdbApiKeyEmpty) MoviePojo.MOVIES_LOCAL_LIST else MovieList.name(this) \ No newline at end of file diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/FeedMoviesRemoteMediator.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/FeedMoviesRemoteMediator.kt index 698b91fd1..60f2631db 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/FeedMoviesRemoteMediator.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/FeedMoviesRemoteMediator.kt @@ -12,7 +12,7 @@ import org.michaelbel.movies.network.ktx.isEmpty import org.michaelbel.movies.network.ktx.isPaginationReached import org.michaelbel.movies.network.ktx.nextPage import org.michaelbel.movies.persistence.database.MoviesDatabase -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.typealiases.PagingKey import org.michaelbel.movies.repository.MovieRepository import org.michaelbel.movies.repository.PagingKeyRepository diff --git a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/SearchMoviesRemoteMediator.kt b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/SearchMoviesRemoteMediator.kt index b14981d3c..f061ed942 100644 --- a/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/SearchMoviesRemoteMediator.kt +++ b/core/interactor/src/commonMain/kotlin/org/michaelbel/movies/interactor/remote/SearchMoviesRemoteMediator.kt @@ -12,7 +12,7 @@ import org.michaelbel.movies.network.ktx.isEmpty import org.michaelbel.movies.network.ktx.isPaginationReached import org.michaelbel.movies.network.ktx.nextPage import org.michaelbel.movies.persistence.database.MoviesDatabase -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.typealiases.Query import org.michaelbel.movies.repository.MovieRepository import org.michaelbel.movies.repository.PagingKeyRepository diff --git a/core/persistence/build.gradle.kts b/core/persistence/build.gradle.kts index b9ed00e83..972d6cc22 100644 --- a/core/persistence/build.gradle.kts +++ b/core/persistence/build.gradle.kts @@ -1,6 +1,7 @@ plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) + alias(libs.plugins.androidx.room) alias(libs.plugins.google.ksp) } @@ -20,11 +21,12 @@ kotlin { api(project(":core:network")) implementation(libs.bundles.datastore.common) implementation(libs.bundles.paging.common) + implementation(libs.bundles.room.common) + implementation(libs.bundles.sqlite.common) implementation(libs.bundles.okio.common) } androidMain.dependencies { implementation(libs.bundles.datastore.android) - implementation(libs.bundles.room.android) } val desktopMain by getting desktopMain.dependencies { @@ -52,8 +54,12 @@ android { checkDependencies = true lintConfig = file("${project.rootDir}/config/codestyle/lint.xml") } +} - dependencies { - ksp(libs.bundles.room.compiler.android) - } +dependencies { + add("kspAndroid", libs.bundles.room.compiler.common) +} + +room { + schemaDirectory("$projectDir/schemas") } \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt deleted file mode 100644 index 107217890..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt +++ /dev/null @@ -1,26 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.dao.AccountDao -import org.michaelbel.movies.persistence.database.entity.AccountPojo -import org.michaelbel.movies.persistence.database.ktx.accountDb -import org.michaelbel.movies.persistence.database.typealiases.AccountId - -actual class AccountPersistence internal constructor( - private val accountDao: AccountDao -) { - - actual fun accountById(accountId: AccountId): Flow { - return accountDao.accountById(accountId) - } - - actual suspend fun insert(account: AccountPojo) { - accountDao.insert(account.accountDb) - } - - actual suspend fun removeById(accountId: AccountId) { - accountDao.removeById(accountId) - } -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt deleted file mode 100644 index 4c1b3bae6..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt +++ /dev/null @@ -1,22 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.dao.ImageDao -import org.michaelbel.movies.persistence.database.entity.ImagePojo -import org.michaelbel.movies.persistence.database.ktx.imageDb -import org.michaelbel.movies.persistence.database.typealiases.MovieId - -actual class ImagePersistence internal constructor( - private val imageDao: ImageDao -) { - - actual fun imagesFlow(movieId: MovieId): Flow> { - return imageDao.imagesFlow(movieId) - } - - actual suspend fun insert(images: List) { - imageDao.insert(images.map(ImagePojo::imageDb)) - } -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt deleted file mode 100644 index 1b6997964..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt +++ /dev/null @@ -1,66 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import androidx.paging.PagingSource -import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.dao.MovieDao -import org.michaelbel.movies.persistence.database.entity.MoviePojo -import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini -import org.michaelbel.movies.persistence.database.ktx.movieDb -import org.michaelbel.movies.persistence.database.typealiases.Limit -import org.michaelbel.movies.persistence.database.typealiases.MovieId -import org.michaelbel.movies.persistence.database.typealiases.PagingKey - -actual class MoviePersistence internal constructor( - private val movieDao: MovieDao -) { - - actual fun pagingSource(pagingKey: PagingKey): PagingSource { - return movieDao.pagingSource(pagingKey) - } - - actual fun moviesFlow(pagingKey: PagingKey, limit: Limit): Flow> { - return movieDao.moviesFlow(pagingKey, limit) - } - - actual suspend fun movies(pagingKey: PagingKey, limit: Limit): List { - return movieDao.movies(pagingKey, limit) - } - - actual suspend fun moviesMini(pagingKey: PagingKey, limit: Limit): List { - return movieDao.moviesMini(pagingKey, limit) - } - - actual suspend fun insertMovies(movies: List) { - movieDao.insertMovies(movies.map(MoviePojo::movieDb)) - } - - actual suspend fun insertMovie(movie: MoviePojo) { - movieDao.insertMovie(movie.movieDb) - } - - actual suspend fun removeMovies(pagingKey: PagingKey) { - movieDao.removeMovies(pagingKey) - } - - actual suspend fun removeMovie(pagingKey: PagingKey, movieId: MovieId) { - movieDao.removeMovie(pagingKey, movieId) - } - - actual suspend fun movieById(pagingKey: PagingKey, movieId: MovieId): MoviePojo? { - return movieDao.movieById(pagingKey, movieId) - } - - actual suspend fun maxPosition(pagingKey: PagingKey): Int? { - return movieDao.maxPosition(pagingKey) - } - - actual suspend fun isEmpty(pagingKey: PagingKey): Boolean { - return movieDao.isEmpty(pagingKey) - } - - actual suspend fun updateMovieColors(movieId: MovieId, containerColor: Int, onContainerColor: Int) { - movieDao.updateMovieColors(movieId, containerColor, onContainerColor) - } -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt deleted file mode 100644 index 770737059..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt +++ /dev/null @@ -1,29 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import org.michaelbel.movies.persistence.database.dao.PagingKeyDao -import org.michaelbel.movies.persistence.database.entity.PagingKeyPojo -import org.michaelbel.movies.persistence.database.ktx.pagingKeyDb -import org.michaelbel.movies.persistence.database.typealiases.PagingKey - -actual class PagingKeyPersistence internal constructor( - private val pagingKeyDao: PagingKeyDao -) { - - actual suspend fun page(pagingKey: PagingKey): Int? { - return pagingKeyDao.page(pagingKey) - } - - actual suspend fun totalPages(pagingKey: PagingKey): Int? { - return pagingKeyDao.totalPages(pagingKey) - } - - actual suspend fun removePagingKey(pagingKey: PagingKey) { - pagingKeyDao.removePagingKey(pagingKey) - } - - actual suspend fun insertPagingKey(pagingKeyPojo: PagingKeyPojo) { - pagingKeyDao.insertPagingKey(pagingKeyPojo.pagingKeyDb) - } -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt deleted file mode 100644 index 080fd4f14..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt +++ /dev/null @@ -1,25 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.dao.SuggestionDao -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo -import org.michaelbel.movies.persistence.database.ktx.suggestionDb - -actual class SuggestionPersistence internal constructor( - private val suggestionDao: SuggestionDao -) { - - actual fun suggestionsFlow(): Flow> { - return suggestionDao.suggestionsFlow() - } - - actual suspend fun insert(suggestions: List) { - suggestionDao.insert(suggestions.map(SuggestionPojo::suggestionDb)) - } - - actual suspend fun removeAll() { - suggestionDao.removeAll() - } -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt deleted file mode 100644 index 15f7e6a7a..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt +++ /dev/null @@ -1,15 +0,0 @@ -package org.michaelbel.movies.persistence.database.di - -import org.koin.dsl.module -import org.michaelbel.movies.persistence.database.db.AppDatabase - -actual val daoKoinModule = module { - includes( - databaseKoinModule - ) - single { get().movieDao() } - single { get().imageDao() } - single { get().accountDao() } - single { get().pagingKeyDao() } - single { get().suggestionDao() } -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.kt index c5caab83d..651dc88e7 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.kt +++ b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/DatabaseKoinModule.kt @@ -1,9 +1,19 @@ package org.michaelbel.movies.persistence.database.di -import org.koin.android.ext.koin.androidContext +import android.app.Application +import androidx.room.Room +import kotlinx.coroutines.Dispatchers +import org.koin.android.ext.koin.androidApplication import org.koin.dsl.module import org.michaelbel.movies.persistence.database.db.AppDatabase actual val databaseKoinModule = module { - single { AppDatabase.getInstance(androidContext()) } + single { createRoomDatabase(androidApplication()) } +} + +private fun createRoomDatabase(app: Application): AppDatabase { + val dbFile = app.getDatabasePath(AppDatabase.DATABASE_NAME) + return Room.databaseBuilder(app, dbFile.absolutePath) + .setQueryCoroutineContext(Dispatchers.IO) + .build() } \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt deleted file mode 100644 index 1ab9864ae..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.michaelbel.movies.persistence.database.di - -import org.koin.dsl.module -import org.michaelbel.movies.persistence.database.AccountPersistence -import org.michaelbel.movies.persistence.database.ImagePersistence -import org.michaelbel.movies.persistence.database.MoviePersistence -import org.michaelbel.movies.persistence.database.PagingKeyPersistence -import org.michaelbel.movies.persistence.database.SuggestionPersistence - -actual val persistenceKoinModule = module { - includes( - daoKoinModule - ) - single { AccountPersistence(get()) } - single { ImagePersistence(get()) } - single { MoviePersistence(get()) } - single { PagingKeyPersistence(get()) } - single { SuggestionPersistence(get()) } -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountPojoKtx.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountPojoKtx.kt deleted file mode 100644 index 843eeb182..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountPojoKtx.kt +++ /dev/null @@ -1,15 +0,0 @@ -package org.michaelbel.movies.persistence.database.ktx - -import org.michaelbel.movies.persistence.database.entity.AccountDb -import org.michaelbel.movies.persistence.database.entity.AccountPojo - -internal val AccountPojo.accountDb: AccountDb - get() = AccountDb( - accountId = accountId, - avatarUrl = avatarUrl, - language = language, - country = country, - name = name, - adult = adult, - username = username - ) \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImagePojoKtx.kt b/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImagePojoKtx.kt deleted file mode 100644 index 69364624d..000000000 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImagePojoKtx.kt +++ /dev/null @@ -1,18 +0,0 @@ -package org.michaelbel.movies.persistence.database.ktx - -import org.michaelbel.movies.persistence.database.entity.ImageDb -import org.michaelbel.movies.persistence.database.entity.ImagePojo - -internal val ImagePojo.imageDb: ImageDb - get() = ImageDb( - movieId = movieId, - filePath = filePath, - type = type, - width = width, - height = height, - aspectRatio = aspectRatio, - voteAverage = voteAverage, - voteCount = voteCount, - lang = lang, - position = position - ) \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt index 475afdc0d..ccdbc87f6 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt @@ -1,22 +1,24 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - package org.michaelbel.movies.persistence.database import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.dao.AccountDao +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo +import org.michaelbel.movies.persistence.database.ktx.accountDb import org.michaelbel.movies.persistence.database.typealiases.AccountId -expect class AccountPersistence { +class AccountPersistence internal constructor( + private val accountDao: AccountDao +) { - fun accountById( - accountId: AccountId - ): Flow + fun accountById(accountId: AccountId): Flow { + return accountDao.accountById(accountId) + } - suspend fun insert( - account: AccountPojo - ) + suspend fun insert(account: AccountPojo) { + accountDao.insert(account.accountDb) + } - suspend fun removeById( - accountId: AccountId - ) + suspend fun removeById(accountId: AccountId) { + accountDao.removeById(accountId) + } } \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt index 3165f153e..ea92f8888 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt @@ -1,18 +1,20 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - package org.michaelbel.movies.persistence.database import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.ImagePojo +import org.michaelbel.movies.persistence.database.dao.ImageDao +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo +import org.michaelbel.movies.persistence.database.ktx.imageDb import org.michaelbel.movies.persistence.database.typealiases.MovieId -expect class ImagePersistence { +class ImagePersistence internal constructor( + private val imageDao: ImageDao +) { - fun imagesFlow( - movieId: MovieId - ): Flow> + fun imagesFlow(movieId: MovieId): Flow> { + return imageDao.imagesFlow(movieId) + } - suspend fun insert( - images: List - ) + suspend fun insert(images: List) { + imageDao.insert(images.map(ImagePojo::imageDb)) + } } \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt index 2a3f9c3b0..8589529f5 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt @@ -1,69 +1,64 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - package org.michaelbel.movies.persistence.database import androidx.paging.PagingSource import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.dao.MovieDao import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo +import org.michaelbel.movies.persistence.database.ktx.movieDb import org.michaelbel.movies.persistence.database.typealiases.Limit import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.PagingKey -expect class MoviePersistence { +class MoviePersistence internal constructor( + private val movieDao: MovieDao +) { - fun pagingSource( - pagingKey: PagingKey - ): PagingSource + fun pagingSource(pagingKey: PagingKey): PagingSource { + return movieDao.pagingSource(pagingKey) + } - fun moviesFlow( - pagingKey: PagingKey, - limit: Limit - ): Flow> + fun moviesFlow(pagingKey: PagingKey, limit: Limit): Flow> { + return movieDao.moviesFlow(pagingKey, limit) + } - suspend fun movies( - pagingKey: PagingKey, - limit: Limit - ): List + suspend fun movies(pagingKey: PagingKey, limit: Limit): List { + return movieDao.movies(pagingKey, limit) + } - suspend fun moviesMini( - pagingKey: PagingKey, - limit: Limit - ): List + suspend fun moviesMini(pagingKey: PagingKey, limit: Limit): List { + return movieDao.moviesMini(pagingKey, limit) + } - suspend fun insertMovies( - movies: List - ) + suspend fun insertMovies(movies: List) { + movieDao.insertMovies(movies.map(MoviePojo::movieDb)) + } - suspend fun insertMovie( - movie: MoviePojo - ) + suspend fun insertMovie(movie: MoviePojo) { + movieDao.insertMovie(movie.movieDb) + } - suspend fun removeMovies( - pagingKey: PagingKey - ) + suspend fun removeMovies(pagingKey: PagingKey) { + movieDao.removeMovies(pagingKey) + } - suspend fun removeMovie( - pagingKey: PagingKey, - movieId: MovieId - ) + suspend fun removeMovie(pagingKey: PagingKey, movieId: MovieId) { + movieDao.removeMovie(pagingKey, movieId) + } - suspend fun movieById( - pagingKey: PagingKey, - movieId: MovieId - ): MoviePojo? + suspend fun movieById(pagingKey: PagingKey, movieId: MovieId): MoviePojo? { + return movieDao.movieById(pagingKey, movieId) + } - suspend fun maxPosition( - pagingKey: PagingKey - ): Int? + suspend fun maxPosition(pagingKey: PagingKey): Int? { + return movieDao.maxPosition(pagingKey) + } - suspend fun isEmpty( - pagingKey: PagingKey - ): Boolean + suspend fun isEmpty(pagingKey: PagingKey): Boolean { + return movieDao.isEmpty(pagingKey) + } - suspend fun updateMovieColors( - movieId: MovieId, - containerColor: Int, - onContainerColor: Int - ) + suspend fun updateMovieColors(movieId: MovieId, containerColor: Int, onContainerColor: Int) { + movieDao.updateMovieColors(movieId, containerColor, onContainerColor) + } } \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt index 9c9efa129..6cd792b92 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt @@ -1,25 +1,27 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - package org.michaelbel.movies.persistence.database -import org.michaelbel.movies.persistence.database.entity.PagingKeyPojo +import org.michaelbel.movies.persistence.database.dao.PagingKeyDao +import org.michaelbel.movies.persistence.database.entity.pojo.PagingKeyPojo +import org.michaelbel.movies.persistence.database.ktx.pagingKeyDb import org.michaelbel.movies.persistence.database.typealiases.PagingKey -expect class PagingKeyPersistence { +class PagingKeyPersistence internal constructor( + private val pagingKeyDao: PagingKeyDao +) { - suspend fun page( - pagingKey: PagingKey - ): Int? + suspend fun page(pagingKey: PagingKey): Int? { + return pagingKeyDao.page(pagingKey) + } - suspend fun totalPages( - pagingKey: PagingKey - ): Int? + suspend fun totalPages(pagingKey: PagingKey): Int? { + return pagingKeyDao.totalPages(pagingKey) + } - suspend fun removePagingKey( - pagingKey: PagingKey - ) + suspend fun removePagingKey(pagingKey: PagingKey) { + pagingKeyDao.removePagingKey(pagingKey) + } - suspend fun insertPagingKey( - pagingKeyPojo: PagingKeyPojo - ) + suspend fun insertPagingKey(pagingKeyPojo: PagingKeyPojo) { + pagingKeyDao.insertPagingKey(pagingKeyPojo.pagingKeyDb) + } } \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt index 0dd577011..ebd6a9b1a 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt @@ -1,17 +1,23 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - package org.michaelbel.movies.persistence.database import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.dao.SuggestionDao +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo +import org.michaelbel.movies.persistence.database.ktx.suggestionDb -expect class SuggestionPersistence { +class SuggestionPersistence internal constructor( + private val suggestionDao: SuggestionDao +) { - fun suggestionsFlow(): Flow> + fun suggestionsFlow(): Flow> { + return suggestionDao.suggestionsFlow() + } - suspend fun insert( - suggestions: List - ) + suspend fun insert(suggestions: List) { + suggestionDao.insert(suggestions.map(SuggestionPojo::suggestionDb)) + } - suspend fun removeAll() + suspend fun removeAll() { + suggestionDao.removeAll() + } } \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/converter/CalendarConverter.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/converter/CalendarConverter.kt similarity index 100% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/converter/CalendarConverter.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/converter/CalendarConverter.kt diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/AccountDao.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/AccountDao.kt similarity index 91% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/AccountDao.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/AccountDao.kt index dbdb93958..9d5a66da1 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/AccountDao.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/AccountDao.kt @@ -6,7 +6,7 @@ import androidx.room.OnConflictStrategy import androidx.room.Query import kotlinx.coroutines.flow.Flow import org.michaelbel.movies.persistence.database.entity.AccountDb -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.typealiases.AccountId /** diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/ImageDao.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/ImageDao.kt similarity index 90% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/ImageDao.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/ImageDao.kt index 250698359..f992e5e74 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/ImageDao.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/ImageDao.kt @@ -6,7 +6,7 @@ import androidx.room.OnConflictStrategy import androidx.room.Query import kotlinx.coroutines.flow.Flow import org.michaelbel.movies.persistence.database.entity.ImageDb -import org.michaelbel.movies.persistence.database.entity.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo import org.michaelbel.movies.persistence.database.typealiases.MovieId /** diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieDao.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieDao.kt similarity index 97% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieDao.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieDao.kt index 52c48604e..27a82762a 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieDao.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/MovieDao.kt @@ -9,8 +9,8 @@ import androidx.room.RewriteQueriesToDropUnusedColumns import androidx.room.Transaction import kotlinx.coroutines.flow.Flow import org.michaelbel.movies.persistence.database.entity.MovieDb -import org.michaelbel.movies.persistence.database.entity.MoviePojo import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.typealiases.Limit import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.PagingKey diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/PagingKeyDao.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/PagingKeyDao.kt similarity index 100% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/PagingKeyDao.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/PagingKeyDao.kt diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/SuggestionDao.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/SuggestionDao.kt similarity index 89% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/SuggestionDao.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/SuggestionDao.kt index 9d440cb05..dc91e6f87 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/dao/SuggestionDao.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/dao/SuggestionDao.kt @@ -6,7 +6,7 @@ import androidx.room.OnConflictStrategy import androidx.room.Query import kotlinx.coroutines.flow.Flow import org.michaelbel.movies.persistence.database.entity.SuggestionDb -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo /** * The Data Access Object for the [SuggestionDb] class. diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt similarity index 54% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt index adb861043..95c209de0 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/db/AppDatabase.kt @@ -1,8 +1,6 @@ package org.michaelbel.movies.persistence.database.db -import android.content.Context import androidx.room.Database -import androidx.room.Room import androidx.room.RoomDatabase import androidx.room.TypeConverters import org.michaelbel.movies.persistence.database.converter.CalendarConverter @@ -16,7 +14,6 @@ import org.michaelbel.movies.persistence.database.entity.ImageDb import org.michaelbel.movies.persistence.database.entity.MovieDb import org.michaelbel.movies.persistence.database.entity.PagingKeyDb import org.michaelbel.movies.persistence.database.entity.SuggestionDb -import org.michaelbel.movies.persistence.BuildConfig /** * The Room database for this app. @@ -33,31 +30,16 @@ import org.michaelbel.movies.persistence.BuildConfig exportSchema = false ) @TypeConverters(CalendarConverter::class) -internal abstract class AppDatabase: RoomDatabase() { +abstract class AppDatabase: RoomDatabase() { - abstract fun movieDao(): MovieDao - abstract fun imageDao(): ImageDao - abstract fun accountDao(): AccountDao - abstract fun pagingKeyDao(): PagingKeyDao - abstract fun suggestionDao(): SuggestionDao + internal abstract fun movieDao(): MovieDao + internal abstract fun imageDao(): ImageDao + internal abstract fun accountDao(): AccountDao + internal abstract fun pagingKeyDao(): PagingKeyDao + internal abstract fun suggestionDao(): SuggestionDao companion object { - private val DATABASE_NAME = if (BuildConfig.DEBUG) "movies-db-debug" else "movies-db" - const val DATABASE_VERSION = 23 - - @Volatile - private var instance: AppDatabase? = null - - fun getInstance(context: Context): AppDatabase { - return instance ?: synchronized(this) { - instance ?: buildDatabase(context).also { instance = it } - } - } - - private fun buildDatabase(context: Context): AppDatabase { - return Room.databaseBuilder(context, AppDatabase::class.java, DATABASE_NAME) - .fallbackToDestructiveMigration() - .build() - } + const val DATABASE_NAME = "movies.db" + const val DATABASE_VERSION = 25 } } \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt index 4c43a4014..75ac0fde1 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt @@ -1,5 +1,15 @@ package org.michaelbel.movies.persistence.database.di -import org.koin.core.module.Module +import org.koin.dsl.module +import org.michaelbel.movies.persistence.database.db.AppDatabase -expect val daoKoinModule: Module \ No newline at end of file +internal val daoKoinModule = module { + includes( + databaseKoinModule + ) + single { get().movieDao() } + single { get().imageDao() } + single { get().accountDao() } + single { get().pagingKeyDao() } + single { get().suggestionDao() } +} \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt index 49769ba24..54904e12a 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt @@ -1,5 +1,19 @@ package org.michaelbel.movies.persistence.database.di -import org.koin.core.module.Module +import org.koin.dsl.module +import org.michaelbel.movies.persistence.database.AccountPersistence +import org.michaelbel.movies.persistence.database.ImagePersistence +import org.michaelbel.movies.persistence.database.MoviePersistence +import org.michaelbel.movies.persistence.database.PagingKeyPersistence +import org.michaelbel.movies.persistence.database.SuggestionPersistence -expect val persistenceKoinModule: Module \ No newline at end of file +val persistenceKoinModule = module { + includes( + daoKoinModule + ) + single { AccountPersistence(get()) } + single { ImagePersistence(get()) } + single { MoviePersistence(get()) } + single { PagingKeyPersistence(get()) } + single { SuggestionPersistence(get()) } +} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/AccountDb.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/AccountDb.kt similarity index 100% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/AccountDb.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/AccountDb.kt diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageDb.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageDb.kt similarity index 88% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageDb.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageDb.kt index 458073c86..118f991ae 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageDb.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageDb.kt @@ -1,6 +1,7 @@ package org.michaelbel.movies.persistence.database.entity import androidx.room.Entity +import org.michaelbel.movies.persistence.database.entity.pojo.ImageType import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.Position diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageType.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageType.kt deleted file mode 100644 index b9ef887fe..000000000 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImageType.kt +++ /dev/null @@ -1,7 +0,0 @@ -package org.michaelbel.movies.persistence.database.entity - -enum class ImageType { - BACKDROP, - POSTER, - LOGO -} \ No newline at end of file diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/MovieDb.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/MovieDb.kt similarity index 100% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/MovieDb.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/MovieDb.kt diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/PagingKeyDb.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/PagingKeyDb.kt similarity index 100% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/PagingKeyDb.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/PagingKeyDb.kt diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/SuggestionDb.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/SuggestionDb.kt similarity index 100% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/entity/SuggestionDb.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/SuggestionDb.kt diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/SuggestionPojo.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/SuggestionPojo.kt deleted file mode 100644 index 3e805812d..000000000 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/SuggestionPojo.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.michaelbel.movies.persistence.database.entity - -data class SuggestionPojo( - val title: String -) \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/AccountPojo.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/AccountPojo.kt similarity index 89% rename from core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/AccountPojo.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/AccountPojo.kt index 59b8b53d4..6d08a06cd 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/AccountPojo.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/AccountPojo.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.persistence.database.entity +package org.michaelbel.movies.persistence.database.entity.pojo import org.michaelbel.movies.persistence.database.typealiases.AccountId diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImagePojo.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/ImagePojo.kt similarity index 91% rename from core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImagePojo.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/ImagePojo.kt index d37c57cbd..b6758fba3 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/ImagePojo.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/ImagePojo.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.persistence.database.entity +package org.michaelbel.movies.persistence.database.entity.pojo import org.michaelbel.movies.persistence.database.typealiases.MovieId diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/ImageType.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/ImageType.kt new file mode 100644 index 000000000..43ad59ceb --- /dev/null +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/ImageType.kt @@ -0,0 +1,7 @@ +package org.michaelbel.movies.persistence.database.entity.pojo + +enum class ImageType { + BACKDROP, + POSTER, + LOGO +} \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/MoviePojo.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/MoviePojo.kt similarity index 95% rename from core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/MoviePojo.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/MoviePojo.kt index db214598f..34a02d103 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/MoviePojo.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/MoviePojo.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.persistence.database.entity +package org.michaelbel.movies.persistence.database.entity.pojo import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.Page diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/PagingKeyPojo.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/PagingKeyPojo.kt similarity index 79% rename from core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/PagingKeyPojo.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/PagingKeyPojo.kt index 5b08721e4..7096b7434 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/PagingKeyPojo.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/PagingKeyPojo.kt @@ -1,4 +1,4 @@ -package org.michaelbel.movies.persistence.database.entity +package org.michaelbel.movies.persistence.database.entity.pojo import org.michaelbel.movies.persistence.database.typealiases.Page import org.michaelbel.movies.persistence.database.typealiases.PagingKey diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/SuggestionPojo.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/SuggestionPojo.kt new file mode 100644 index 000000000..05f985b0f --- /dev/null +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/entity/pojo/SuggestionPojo.kt @@ -0,0 +1,5 @@ +package org.michaelbel.movies.persistence.database.entity.pojo + +data class SuggestionPojo( + val title: String +) \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountKtx.kt index 749e4a8da..b7cc83dea 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountKtx.kt @@ -3,7 +3,7 @@ package org.michaelbel.movies.persistence.database.ktx import org.michaelbel.movies.network.config.GRAVATAR_URL import org.michaelbel.movies.network.config.formatProfileImage import org.michaelbel.movies.network.model.Account -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import java.util.Locale val Account.accountPojo: AccountPojo diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonAccountPojoKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountPojoKtx.kt similarity index 73% rename from core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonAccountPojoKtx.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountPojoKtx.kt index 5817c1b48..0194ffd66 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonAccountPojoKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/AccountPojoKtx.kt @@ -1,12 +1,24 @@ package org.michaelbel.movies.persistence.database.ktx -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.AccountDb +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo private const val ACCOUNT_DEFAULT_LETTER = "A" private const val SPACE_UNICODE = "\u0020" private const val LETTERS_LIMIT = 2 private const val FIRST_LETTER_INDEX = 1 +internal val AccountPojo.accountDb: AccountDb + get() = AccountDb( + accountId = accountId, + avatarUrl = avatarUrl, + language = language, + country = country, + name = name, + adult = adult, + username = username + ) + val AccountPojo.isEmpty: Boolean get() = this == AccountPojo.Empty diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonMoviePojoKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonMoviePojoKtx.kt deleted file mode 100644 index 4b9766198..000000000 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonMoviePojoKtx.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.michaelbel.movies.persistence.database.ktx - -import org.michaelbel.movies.network.config.TMDB_MOVIE_URL -import org.michaelbel.movies.persistence.database.entity.MoviePojo -import java.util.Locale - -val MoviePojo.isNotEmpty: Boolean - get() = this != MoviePojo.Empty - -val MoviePojo.url: String - get() = String.format(Locale.US, TMDB_MOVIE_URL, movieId) - -val MoviePojo?.orEmpty: MoviePojo - get() = this ?: MoviePojo.Empty \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImageKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImageKtx.kt index 362d967e6..0f472c100 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImageKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImageKtx.kt @@ -1,8 +1,8 @@ package org.michaelbel.movies.persistence.database.ktx import org.michaelbel.movies.network.model.Image -import org.michaelbel.movies.persistence.database.entity.ImagePojo -import org.michaelbel.movies.persistence.database.entity.ImageType +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImageType import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.Position diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonImagePojoKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImagePojoKtx.kt similarity index 60% rename from core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonImagePojoKtx.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImagePojoKtx.kt index c96be8e36..623f6e1bb 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/CommonImagePojoKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/ImagePojoKtx.kt @@ -4,8 +4,23 @@ import org.michaelbel.movies.network.config.formatImage import org.michaelbel.movies.network.model.image.BackdropSize import org.michaelbel.movies.network.model.image.LogoSize import org.michaelbel.movies.network.model.image.PosterSize -import org.michaelbel.movies.persistence.database.entity.ImagePojo -import org.michaelbel.movies.persistence.database.entity.ImageType +import org.michaelbel.movies.persistence.database.entity.ImageDb +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImageType + +internal val ImagePojo.imageDb: ImageDb + get() = ImageDb( + movieId = movieId, + filePath = filePath, + type = type, + width = width, + height = height, + aspectRatio = aspectRatio, + voteAverage = voteAverage, + voteCount = voteCount, + lang = lang, + position = position + ) val ImagePojo.image: String get() = when (type) { diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieKtx.kt index b60354cf5..ef68cc51d 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieKtx.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.persistence.database.ktx import org.michaelbel.movies.network.model.Movie -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo val Movie.moviePojo: MoviePojo get() = MoviePojo( diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MoviePojoKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MoviePojoKtx.kt similarity index 60% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MoviePojoKtx.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MoviePojoKtx.kt index 898ee6d75..640956132 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MoviePojoKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MoviePojoKtx.kt @@ -1,7 +1,9 @@ package org.michaelbel.movies.persistence.database.ktx +import java.util.Locale +import org.michaelbel.movies.network.config.TMDB_MOVIE_URL import org.michaelbel.movies.persistence.database.entity.MovieDb -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo internal val MoviePojo.movieDb: MovieDb get() = MovieDb( @@ -18,4 +20,13 @@ internal val MoviePojo.movieDb: MovieDb voteAverage = voteAverage, containerColor = containerColor, onContainerColor = onContainerColor - ) \ No newline at end of file + ) + +val MoviePojo.isNotEmpty: Boolean + get() = this != MoviePojo.Empty + +val MoviePojo.url: String + get() = String.format(Locale.US, TMDB_MOVIE_URL, movieId) + +val MoviePojo?.orEmpty: MoviePojo + get() = this ?: MoviePojo.Empty \ No newline at end of file diff --git a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieResponseKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieResponseKtx.kt index 3295bd9c1..e96d36637 100644 --- a/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieResponseKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/MovieResponseKtx.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.persistence.database.ktx import org.michaelbel.movies.network.model.MovieResponse -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.typealiases.Page import org.michaelbel.movies.persistence.database.typealiases.Position diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/PagingKeyPojoKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/PagingKeyPojoKtx.kt similarity index 79% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/PagingKeyPojoKtx.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/PagingKeyPojoKtx.kt index e69a1fc69..02ca0fa8d 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/PagingKeyPojoKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/PagingKeyPojoKtx.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.persistence.database.ktx import org.michaelbel.movies.persistence.database.entity.PagingKeyDb -import org.michaelbel.movies.persistence.database.entity.PagingKeyPojo +import org.michaelbel.movies.persistence.database.entity.pojo.PagingKeyPojo internal val PagingKeyPojo.pagingKeyDb: PagingKeyDb get() = PagingKeyDb( diff --git a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/SuggestionPojoKtx.kt b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/SuggestionPojoKtx.kt similarity index 75% rename from core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/SuggestionPojoKtx.kt rename to core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/SuggestionPojoKtx.kt index 25f2c5820..ce51c661a 100644 --- a/core/persistence/src/androidMain/kotlin/org/michaelbel/movies/persistence/database/ktx/SuggestionPojoKtx.kt +++ b/core/persistence/src/commonMain/kotlin/org/michaelbel/movies/persistence/database/ktx/SuggestionPojoKtx.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.persistence.database.ktx import org.michaelbel.movies.persistence.database.entity.SuggestionDb -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo internal val SuggestionPojo.suggestionDb: SuggestionDb get() = SuggestionDb( diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt b/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt deleted file mode 100644 index 5dfedb7c2..000000000 --- a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/AccountPersistence.kt +++ /dev/null @@ -1,25 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.emptyFlow -import org.michaelbel.movies.persistence.database.entity.AccountPojo -import org.michaelbel.movies.persistence.database.typealiases.AccountId - -actual class AccountPersistence internal constructor() { - - actual fun accountById( - accountId: AccountId - ): Flow { - return emptyFlow() - } - - actual suspend fun insert( - account: AccountPojo - ) {} - - actual suspend fun removeById( - accountId: AccountId - ) {} -} \ No newline at end of file diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt b/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt deleted file mode 100644 index fdaa08c90..000000000 --- a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/ImagePersistence.kt +++ /dev/null @@ -1,21 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.emptyFlow -import org.michaelbel.movies.persistence.database.entity.ImagePojo -import org.michaelbel.movies.persistence.database.typealiases.MovieId - -actual class ImagePersistence internal constructor() { - - actual fun imagesFlow( - movieId: MovieId - ): Flow> { - return emptyFlow() - } - - actual suspend fun insert( - images: List - ) {} -} \ No newline at end of file diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt b/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt deleted file mode 100644 index 90bfd2d13..000000000 --- a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/MoviePersistence.kt +++ /dev/null @@ -1,84 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import androidx.paging.PagingSource -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.emptyFlow -import org.michaelbel.movies.persistence.database.entity.MoviePojo -import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini -import org.michaelbel.movies.persistence.database.typealiases.Limit -import org.michaelbel.movies.persistence.database.typealiases.MovieId -import org.michaelbel.movies.persistence.database.typealiases.PagingKey - -actual class MoviePersistence internal constructor() { - - actual fun pagingSource( - pagingKey: PagingKey - ): PagingSource { - TODO("Not Implemented") - } - - actual fun moviesFlow( - pagingKey: PagingKey, - limit: Limit - ): Flow> { - return emptyFlow() - } - - actual suspend fun movies( - pagingKey: PagingKey, - limit: Limit - ): List { - return emptyList() - } - - actual suspend fun moviesMini( - pagingKey: PagingKey, - limit: Limit - ): List { - return emptyList() - } - - actual suspend fun insertMovies( - movies: List - ) {} - - actual suspend fun insertMovie( - movie: MoviePojo - ) {} - - actual suspend fun removeMovies( - pagingKey: PagingKey - ) {} - - actual suspend fun removeMovie( - pagingKey: PagingKey, - movieId: MovieId - ) {} - - actual suspend fun movieById( - pagingKey: PagingKey, - movieId: MovieId - ): MoviePojo? { - return null - } - - actual suspend fun maxPosition( - pagingKey: PagingKey - ): Int? { - return null - } - - actual suspend fun isEmpty( - pagingKey: PagingKey - ): Boolean { - return true - } - - actual suspend fun updateMovieColors( - movieId: MovieId, - containerColor: Int, - onContainerColor: Int - ) {} -} \ No newline at end of file diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt b/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt deleted file mode 100644 index 5e2a473b3..000000000 --- a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/PagingKeyPersistence.kt +++ /dev/null @@ -1,29 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import org.michaelbel.movies.persistence.database.entity.PagingKeyPojo -import org.michaelbel.movies.persistence.database.typealiases.PagingKey - -actual class PagingKeyPersistence internal constructor() { - - actual suspend fun page( - pagingKey: PagingKey - ): Int? { - return null - } - - actual suspend fun totalPages( - pagingKey: PagingKey - ): Int? { - return null - } - - actual suspend fun removePagingKey( - pagingKey: PagingKey - ) {} - - actual suspend fun insertPagingKey( - pagingKeyPojo: PagingKeyPojo - ) {} -} \ No newline at end of file diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt b/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt deleted file mode 100644 index a1bb5c340..000000000 --- a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/SuggestionPersistence.kt +++ /dev/null @@ -1,20 +0,0 @@ -@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") - -package org.michaelbel.movies.persistence.database - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.emptyFlow -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo - -actual class SuggestionPersistence internal constructor() { - - actual fun suggestionsFlow(): Flow> { - return emptyFlow() - } - - actual suspend fun insert( - suggestions: List - ) {} - - actual suspend fun removeAll() {} -} \ No newline at end of file diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt b/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt deleted file mode 100644 index f0cc6ce2f..000000000 --- a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/DaoKoinModule.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.michaelbel.movies.persistence.database.di - -import org.koin.dsl.module - -actual val daoKoinModule = module {} \ No newline at end of file diff --git a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt b/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt deleted file mode 100644 index cea9dc0f1..000000000 --- a/core/persistence/src/desktopMain/kotlin/org/michaelbel/movies/persistence/database/di/PersistenceKoinModule.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.michaelbel.movies.persistence.database.di - -import org.koin.dsl.module - -actual val persistenceKoinModule = module {} \ No newline at end of file diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/AccountRepository.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/AccountRepository.kt index 82ccb8788..b1429256e 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/AccountRepository.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/AccountRepository.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.repository import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.typealiases.AccountId interface AccountRepository { diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/ImageRepository.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/ImageRepository.kt index 7dd9d6618..94aaa0b30 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/ImageRepository.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/ImageRepository.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.repository import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo import org.michaelbel.movies.persistence.database.typealiases.MovieId interface ImageRepository { diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/MovieRepository.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/MovieRepository.kt index eefc842bc..1921a3a22 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/MovieRepository.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/MovieRepository.kt @@ -4,7 +4,7 @@ import androidx.paging.PagingSource import kotlinx.coroutines.flow.Flow import org.michaelbel.movies.network.model.MovieResponse import org.michaelbel.movies.network.model.Result -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini import org.michaelbel.movies.persistence.database.typealiases.Limit import org.michaelbel.movies.persistence.database.typealiases.MovieId diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/SuggestionRepository.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/SuggestionRepository.kt index 48bba64d4..8416c6b29 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/SuggestionRepository.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/SuggestionRepository.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.repository import kotlinx.coroutines.flow.Flow -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo interface SuggestionRepository { diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/AccountRepositoryImpl.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/AccountRepositoryImpl.kt index 67f7777bf..9e069e96c 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/AccountRepositoryImpl.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/AccountRepositoryImpl.kt @@ -9,7 +9,7 @@ import kotlinx.coroutines.flow.map import org.michaelbel.movies.common.exceptions.AccountDetailsException import org.michaelbel.movies.network.AccountNetworkService import org.michaelbel.movies.persistence.database.AccountPersistence -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.ktx.accountPojo import org.michaelbel.movies.persistence.database.ktx.orEmpty import org.michaelbel.movies.persistence.datastore.MoviesPreferences diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/ImageRepositoryImpl.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/ImageRepositoryImpl.kt index be0783c6a..f1b0a7814 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/ImageRepositoryImpl.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/ImageRepositoryImpl.kt @@ -3,8 +3,8 @@ package org.michaelbel.movies.repository.impl import kotlinx.coroutines.flow.Flow import org.michaelbel.movies.network.MovieNetworkService import org.michaelbel.movies.persistence.database.ImagePersistence -import org.michaelbel.movies.persistence.database.entity.ImagePojo -import org.michaelbel.movies.persistence.database.entity.ImageType +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImageType import org.michaelbel.movies.persistence.database.ktx.imagePojo import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.repository.ImageRepository diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/MovieRepositoryImpl.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/MovieRepositoryImpl.kt index 877a83c02..b633e41bb 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/MovieRepositoryImpl.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/MovieRepositoryImpl.kt @@ -10,7 +10,7 @@ import org.michaelbel.movies.network.config.isTmdbApiKeyEmpty import org.michaelbel.movies.network.model.MovieResponse import org.michaelbel.movies.network.model.Result import org.michaelbel.movies.persistence.database.MoviePersistence -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.entity.mini.MovieDbMini import org.michaelbel.movies.persistence.database.ktx.moviePojo import org.michaelbel.movies.persistence.database.ktx.orEmpty diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/PagingKeyRepositoryImpl.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/PagingKeyRepositoryImpl.kt index 402bd48d8..20fabf178 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/PagingKeyRepositoryImpl.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/PagingKeyRepositoryImpl.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.repository.impl import org.michaelbel.movies.persistence.database.PagingKeyPersistence -import org.michaelbel.movies.persistence.database.entity.PagingKeyPojo +import org.michaelbel.movies.persistence.database.entity.pojo.PagingKeyPojo import org.michaelbel.movies.persistence.database.typealiases.Page import org.michaelbel.movies.persistence.database.typealiases.PagingKey import org.michaelbel.movies.repository.PagingKeyRepository diff --git a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/SuggestionRepositoryImpl.kt b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/SuggestionRepositoryImpl.kt index 4c4919b1d..e2b28fb17 100644 --- a/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/SuggestionRepositoryImpl.kt +++ b/core/repository/src/commonMain/kotlin/org/michaelbel/movies/repository/impl/SuggestionRepositoryImpl.kt @@ -5,7 +5,7 @@ import org.michaelbel.movies.network.MovieNetworkService import org.michaelbel.movies.network.model.Movie import org.michaelbel.movies.persistence.database.MoviePersistence import org.michaelbel.movies.persistence.database.SuggestionPersistence -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo import org.michaelbel.movies.repository.SuggestionRepository internal class SuggestionRepositoryImpl( diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt index c2f084aa4..dadf8173f 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt @@ -26,7 +26,7 @@ import coil.compose.AsyncImage import coil.request.ImageRequest import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.config.formatPosterImage -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.ktx.context import org.michaelbel.movies.ui.ktx.isErrorOrEmpty diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt index c1791445b..b1fd8f994 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt @@ -26,7 +26,7 @@ import coil.compose.AsyncImage import coil.request.ImageRequest import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.config.formatBackdropImage -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.ktx.context import org.michaelbel.movies.ui.ktx.isErrorOrEmpty diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.kt index 6367f3d9a..04ba580a5 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageContent.kt @@ -23,7 +23,7 @@ import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.itemContentType import androidx.paging.compose.itemKey import org.michaelbel.movies.common.appearance.FeedView -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.compose.movie.MovieColumn import org.michaelbel.movies.ui.compose.movie.MovieRow import org.michaelbel.movies.ui.ktx.PageContentColumnModifier diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt index 20906acab..67a360cda 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.appearance.FeedView import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.model.MovieResponse -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.compose.movie.MovieColumn import org.michaelbel.movies.ui.compose.movie.MovieRow import org.michaelbel.movies.ui.ktx.gridColumnsCount diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/AccountPreviewParameterProvider.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/AccountPreviewParameterProvider.kt index f2cbef37d..6c3bb632a 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/AccountPreviewParameterProvider.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/AccountPreviewParameterProvider.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.ui.preview.provider import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo class AccountPreviewParameterProvider: CollectionPreviewParameterProvider( listOf( diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt index 39998ccd3..2c44ca822 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt @@ -2,7 +2,7 @@ package org.michaelbel.movies.ui.preview.provider import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider import org.michaelbel.movies.network.model.Movie -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo class MovieDbPreviewParameterProvider: CollectionPreviewParameterProvider( listOf( diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MoviePreviewParameterProvider.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MoviePreviewParameterProvider.kt index 43a41d57a..2ac266bff 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MoviePreviewParameterProvider.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/MoviePreviewParameterProvider.kt @@ -2,7 +2,7 @@ package org.michaelbel.movies.ui.preview.provider import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider import org.michaelbel.movies.network.model.Movie -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo class MoviePreviewParameterProvider: CollectionPreviewParameterProvider( listOf( diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/SuggestionDbPreviewParameterProvider.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/SuggestionDbPreviewParameterProvider.kt index 5de1b1890..2ae2c040b 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/SuggestionDbPreviewParameterProvider.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/provider/SuggestionDbPreviewParameterProvider.kt @@ -1,7 +1,7 @@ package org.michaelbel.movies.ui.preview.provider import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo class SuggestionDbPreviewParameterProvider: CollectionPreviewParameterProvider>( listOf( diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt index a49144544..9c5da8740 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt @@ -21,7 +21,7 @@ import coil3.request.ImageRequest import coil3.request.crossfade import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.ktx.letters import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.ktx.lettersTextFontSizeSmall diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt index f5d2249d0..ecf911d0b 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.common.theme.AppTheme -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.url import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/AccountPojoKtx.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/AccountPojoKtx.kt index 2fd5b0573..f34e34342 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/AccountPojoKtx.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/ktx/AccountPojoKtx.kt @@ -3,7 +3,7 @@ package org.michaelbel.movies.ui.ktx import androidx.compose.runtime.Composable import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.sp -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.ktx.letters val AccountPojo.lettersTextFontSizeSmall: TextUnit diff --git a/core/work/src/androidMain/kotlin/org/michaelbel/movies/work/MoviesDatabaseWorker.kt b/core/work/src/androidMain/kotlin/org/michaelbel/movies/work/MoviesDatabaseWorker.kt index 9795a76f8..8cfe2b5a8 100644 --- a/core/work/src/androidMain/kotlin/org/michaelbel/movies/work/MoviesDatabaseWorker.kt +++ b/core/work/src/androidMain/kotlin/org/michaelbel/movies/work/MoviesDatabaseWorker.kt @@ -12,7 +12,7 @@ import kotlinx.serialization.json.decodeFromStream import org.michaelbel.movies.common.dispatchers.MoviesDispatchers import org.michaelbel.movies.network.model.MovieResponse import org.michaelbel.movies.persistence.database.MoviePersistence -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.moviePojo class MoviesDatabaseWorker( diff --git a/feature/account-impl/src/androidMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt b/feature/account-impl/src/androidMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt index b43414d04..6fa7bebff 100644 --- a/feature/account-impl/src/androidMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt +++ b/feature/account-impl/src/androidMain/kotlin/org/michaelbel/movies/account/AccountViewModel.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.launch import org.michaelbel.movies.common.exceptions.DeleteSessionException import org.michaelbel.movies.common.viewmodel.BaseViewModel import org.michaelbel.movies.interactor.Interactor -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo class AccountViewModel( private val interactor: Interactor diff --git a/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt index 6e084a73a..f898b8e91 100644 --- a/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt +++ b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt @@ -27,7 +27,7 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.common.theme.AppTheme -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.compose.AccountAvatar import org.michaelbel.movies.ui.icons.MoviesIcons diff --git a/feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.kt b/feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.kt index 0a29858fd..9d178b22a 100644 --- a/feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.kt +++ b/feature/account-impl/src/desktopMain/kotlin/org/michaelbel/movies/account/ui/AccountRoute.kt @@ -2,7 +2,7 @@ package org.michaelbel.movies.account.ui import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo @Composable fun AccountRoute( diff --git a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt index a0ca01241..cf690e338 100644 --- a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt +++ b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt @@ -34,7 +34,7 @@ import coil.request.ImageRequest import coil.request.SuccessResult import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.config.formatBackdropImage -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.isNotEmpty import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.ktx.isErrorOrEmpty diff --git a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt index 43092e71b..286ba5441 100644 --- a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt +++ b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt @@ -7,7 +7,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.common.theme.AppTheme -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.theme.MoviesTheme diff --git a/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ktx/ScreenStateKtx.kt b/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ktx/ScreenStateKtx.kt index b0b555cbc..702ec8df5 100644 --- a/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ktx/ScreenStateKtx.kt +++ b/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ktx/ScreenStateKtx.kt @@ -8,7 +8,7 @@ import androidx.compose.ui.graphics.Color import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.stringResource import org.michaelbel.movies.network.config.ScreenState -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.url import org.michaelbel.movies.ui.strings.MoviesStrings diff --git a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt index fec2c0c16..7b6ac6ece 100644 --- a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt +++ b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/FeedViewModel.kt @@ -28,8 +28,8 @@ import org.michaelbel.movies.interactor.Interactor import org.michaelbel.movies.network.connectivity.NetworkManager import org.michaelbel.movies.network.connectivity.NetworkStatus import org.michaelbel.movies.notifications.NotificationClient -import org.michaelbel.movies.persistence.database.entity.AccountPojo -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo class FeedViewModel( savedStateHandle: SavedStateHandle, diff --git a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt index fc3b45534..6d9c0aabf 100644 --- a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt +++ b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt @@ -35,8 +35,8 @@ import org.michaelbel.movies.common.list.MovieList import org.michaelbel.movies.feed.ktx.titleText import org.michaelbel.movies.feed_impl.R import org.michaelbel.movies.network.connectivity.NetworkStatus -import org.michaelbel.movies.persistence.database.entity.AccountPojo -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.compose.NotificationBottomSheet import org.michaelbel.movies.ui.compose.page.PageContent import org.michaelbel.movies.ui.compose.page.PageFailure diff --git a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt index 15aa403a4..ad149c6e3 100644 --- a/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt +++ b/feature/feed-impl/src/androidMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt @@ -29,7 +29,7 @@ import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.feed_impl.R import org.michaelbel.movies.network.config.isTmdbApiKeyEmpty -import org.michaelbel.movies.persistence.database.entity.AccountPojo +import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.ktx.isEmpty import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.compose.AccountAvatar diff --git a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt index e653aee89..417478cd2 100644 --- a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt +++ b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/GalleryViewModel.kt @@ -19,7 +19,7 @@ import org.michaelbel.movies.common.viewmodel.BaseViewModel import org.michaelbel.movies.gallery.ktx.nameRes import org.michaelbel.movies.gallery_impl.R import org.michaelbel.movies.interactor.Interactor -import org.michaelbel.movies.persistence.database.entity.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo import org.michaelbel.movies.persistence.database.ktx.original import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.work.DownloadImageWorker diff --git a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ktx/ImageTypeKtx.kt b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ktx/ImageTypeKtx.kt index bd02c64cc..2f94d195e 100644 --- a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ktx/ImageTypeKtx.kt +++ b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ktx/ImageTypeKtx.kt @@ -2,7 +2,7 @@ package org.michaelbel.movies.gallery.ktx import androidx.annotation.StringRes import org.michaelbel.movies.gallery_impl.R -import org.michaelbel.movies.persistence.database.entity.ImageType +import org.michaelbel.movies.persistence.database.entity.pojo.ImageType internal val ImageType.nameRes: Int @StringRes get() = when (this) { diff --git a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt index 741c5976e..fff0d72b3 100644 --- a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt +++ b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt @@ -54,7 +54,7 @@ import org.michaelbel.movies.gallery.zoomable.rememberZoomState import org.michaelbel.movies.gallery.zoomable.zoomable import org.michaelbel.movies.gallery_impl.R import org.michaelbel.movies.network.config.isNotOriginal -import org.michaelbel.movies.persistence.database.entity.ImagePojo +import org.michaelbel.movies.persistence.database.entity.pojo.ImagePojo import org.michaelbel.movies.persistence.database.ktx.original import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.compose.iconbutton.BackIcon diff --git a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt index d32bc7fbe..5730f8020 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/SearchViewModel.kt @@ -20,8 +20,8 @@ import org.michaelbel.movies.common.viewmodel.BaseViewModel import org.michaelbel.movies.interactor.Interactor import org.michaelbel.movies.network.connectivity.NetworkManager import org.michaelbel.movies.network.connectivity.NetworkStatus -import org.michaelbel.movies.persistence.database.entity.MoviePojo -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.Query diff --git "a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" "b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" index d0ce27f93..4f40b24c3 100644 --- "a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" +++ "b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" @@ -17,7 +17,7 @@ import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import org.michaelbel.movies.common.theme.AppTheme -import org.michaelbel.movies.persistence.database.entity.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.icons.MoviesIcons diff --git a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchScreenContent.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchScreenContent.kt index c4f2979bc..18f6b1cdc 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchScreenContent.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchScreenContent.kt @@ -34,8 +34,8 @@ import org.michaelbel.movies.common.appearance.FeedView import org.michaelbel.movies.common.exceptions.ApiKeyNotNullException import org.michaelbel.movies.common.exceptions.PageEmptyException import org.michaelbel.movies.network.connectivity.NetworkStatus -import org.michaelbel.movies.persistence.database.entity.MoviePojo -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.PagingKey import org.michaelbel.movies.persistence.database.typealiases.Query diff --git a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt index 525e2a54a..9b7b06dec 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt @@ -16,7 +16,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.theme.AppTheme -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.SuggestionDbPreviewParameterProvider import org.michaelbel.movies.ui.theme.MoviesTheme diff --git a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt index 03bc7c2b9..6375c934d 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt @@ -24,8 +24,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.theme.AppTheme -import org.michaelbel.movies.persistence.database.entity.MoviePojo -import org.michaelbel.movies.persistence.database.entity.SuggestionPojo +import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo +import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo import org.michaelbel.movies.persistence.database.typealiases.MovieId import org.michaelbel.movies.persistence.database.typealiases.Query import org.michaelbel.movies.search_impl.R diff --git a/gradle.properties b/gradle.properties index 6d104d72a..edd618ed4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,4 +22,9 @@ android.defaults.buildFeatures.resValues=false # Default value is true. android.defaults.buildFeatures.shaders=false -xcodeproj=./ios-app \ No newline at end of file +xcodeproj=./ios-app + +# kmp +kotlin.mpp.androidGradlePluginCompatibility.nowarn=true +# Disabled due to https://youtrack.jetbrains.com/issue/KT-65761 +kotlin.native.disableCompilerDaemon = true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 123813824..81d3d63ad 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -50,8 +50,9 @@ androidx-navigation = "2.7.7" androidx-palette-ktx = "1.0.0" androidx-paging = "3.2.1" androidx-profile-installer = "1.3.1" -androidx-room = "2.6.1" +androidx-room = "2.7.0-alpha01" androidx-startup = "1.1.1" +androidx-sqlite = "2.5.0-SNAPSHOT" androidx-test = "1.5.2" androidx-test-ext = "1.1.5" androidx-test-uiautomator = "2.3.0" @@ -170,9 +171,9 @@ androidx-paging-compose = { module = "androidx.paging:paging-compose", version.r androidx-profile-installer = { module = "androidx.profileinstaller:profileinstaller", version.ref = "androidx-profile-installer" } androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" } androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" } -androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "androidx-room" } androidx-room-paging = { module = "androidx.room:room-paging", version.ref = "androidx-room" } androidx-startup-runtime = { module = "androidx.startup:startup-runtime", version.ref = "androidx-startup" } +androidx-sqlite-bundled = { module = "androidx.sqlite:sqlite-bundled", version.ref = "androidx-sqlite" } androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" } androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" } androidx-test-ext-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidx-test-ext" } @@ -260,6 +261,16 @@ lifecycle-common = [ paging-common = [ "androidx-paging-compose" ] +room-common = [ + "androidx-room-runtime", + "androidx-room-paging" +] +room-compiler-common = [ + "androidx-room-compiler" +] +sqlite-common = [ + "androidx-sqlite-bundled" +] ktor-common = [ "ktor-client-core", "ktor-client-cio", @@ -371,14 +382,6 @@ navigation-android = [ palette-android = [ "androidx-palette-ktx" ] -room-android = [ - "androidx-room-runtime", - "androidx-room-ktx", - "androidx-room-paging" -] -room-compiler-android = [ - "androidx-room-compiler" -] startup-android = [ "androidx-startup-runtime" ] @@ -475,6 +478,7 @@ android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } android-dynamic-feature = { id = "com.android.dynamic-feature", version.ref = "agp" } android-test = { id = "com.android.test", version.ref = "agp" } +androidx-room = { id = "androidx.room", version.ref = "androidx-room" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/readme.md b/readme.md index 426489540..da016b51d 100644 --- a/readme.md +++ b/readme.md @@ -94,7 +94,7 @@ The app is still usable without an API key. In this case functionality will be l [![Android](https://img.shields.io/badge/Android%20SDK-50AE55?style=for-the-badge&logo=android&logoColor=F6F6F6)](https://d.android.com) [![Firebase](https://img.shields.io/badge/Firebase-E5B82C?style=for-the-badge&logo=Firebase&logoColor=white)](https://firebase.google.com) [![Coil](https://img.shields.io/badge/Coil-3B6BB4?&style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjAwcHgiIGhlaWdodD0iMjAwcHgiIHZpZXdCb3g9IjMzMi41IDIwMCAxNDAgMTQwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBmaWxsPSIjZmZmZmZmIiBkPSJNMzkyLjcyOCwzMDMuMzgybC0zMi4zODQtMjQuMjQxbC0zLjI0MywyLjQzMWMtNS41MjMsNC4xMzEtNS41MjMsMTAuODM3LDAsMTQuOTdsMzUuNjI3LDI2LjY3MiAgICBjNS41MjUsNC4xMzIsMTQuNDc4LDQuMTMyLDIwLjAwMiwwbDM1LjYyNy0yNi42NzJjNS41MjYtNC4xMzMsNS41MjYtMTAuODM5LDAtMTQuOTdsLTMuMjQ2LTIuNDMxbC0zMi4zODEsMjQuMjQxICAgIEM0MDcuMjA2LDMwNy41MTUsMzk4LjI1MywzMDcuNTE1LDM5Mi43MjgsMzAzLjM4MnoiLz4KCQk8cGF0aCBmaWxsPSIjZmZmZmZmIiBkPSJNNDQ4LjM1NywyNjEuNzQybC0zLjI0Ni0yLjQzbC0zMi4zODEsMjQuMjM4Yy01LjUyNSw0LjEzMy0xNC40NzgsNC4xMzMtMjAuMDAyLDBsLTMyLjM4NC0yNC4yMzggICAgbC0zLjI0MywyLjQzYy01LjUyMyw0LjEzMS01LjUyMywxMC44MzUsMCwxNC45NzFsMy4yNDMsMi40MjhsMzIuMzg0LDI0LjI0MWM1LjUyNSw0LjEzMywxNC40NzgsNC4xMzMsMjAuMDAyLDBsMzIuMzgxLTI0LjI0MSAgICBsMy4yNDYtMi40MjhDNDUzLjg4NCwyNzIuNTc3LDQ1My44ODQsMjY1Ljg3Myw0NDguMzU3LDI2MS43NDJ6Ii8+CgkJPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTQxMi43MywyODMuNTUxbDMyLjM4MS0yNC4yMzhsMy4yNDYtMi40MzJjNS41MjYtNC4xMzEsNS41MjYtMTAuODM3LDAtMTQuOTcxbC0yLjk4My0yLjIzMiAgICBsLTM3LjMzOCwyNy44NDNjLTIuOTMyLDIuMTk2LTcuNjg1LDIuMTk2LTEwLjYxNSwwbC0xOC45MTEtMTQuMTVjLTIuOTMxLTIuMTk1LTIuOTMxLTUuNzUyLDAtNy45NDhsMzcuOTEtMjcuNDE5bC0zLjY4OS0yLjc2MSAgICBjLTUuNTI1LTQuMTM2LTE0LjQ3OC00LjEzNi0yMC4wMDIsMGwtMzUuNjI3LDI2LjY2OGMtNS41MjMsNC4xMzMtNS41MjMsMTAuODQsMCwxNC45NzFsMy4yNDMsMi40MzJsMzIuMzg0LDI0LjIzOCAgICBDMzk4LjI1MywyODcuNjg0LDQwNy4yMDYsMjg3LjY4NCw0MTIuNzMsMjgzLjU1MXoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4=&logoColor=white)](https://github.com/coil-kt/coil) -[![Room](https://img.shields.io/badge/Room-39477F?&style=for-the-badge&logo=adminer&logoColor=white)](https://d.android.com/training/data-storage/room) +[![Room Multiplatform](https://img.shields.io/badge/Room-39477F?&style=for-the-badge&logo=adminer&logoColor=white)](https://d.android.com/kotlin/multiplatform/room) [![Clean](https://img.shields.io/badge/Clean%20Architecture-4169E1.svg?style=for-the-badge&logo=ccleaner&logoColor=white)](https://d.android.com/topic/architecture) [![Dependabot](https://img.shields.io/badge/Dependabot-0366D6?&style=for-the-badge&logo=dependabot&logoColor=white)](https://github.com/dependabot) [![Github](https://img.shields.io/badge/Github%20Actions-3F464F?&style=for-the-badge&logo=github&logoColor=white)](https://github.com/michaelbel/movies/tree/develop/.github/workflows) diff --git a/readme.ru.md b/readme.ru.md index 506117911..d4d0d046c 100644 --- a/readme.ru.md +++ b/readme.ru.md @@ -94,7 +94,7 @@ TMDB_API_KEY=your_own_tmdb_api_key [![Android](https://img.shields.io/badge/Android%20SDK-50AE55?style=for-the-badge&logo=android&logoColor=F6F6F6)](https://d.android.com) [![Firebase](https://img.shields.io/badge/Firebase-E5B82C?style=for-the-badge&logo=Firebase&logoColor=white)](https://firebase.google.com) [![Coil](https://img.shields.io/badge/Coil-3B6BB4?&style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjAwcHgiIGhlaWdodD0iMjAwcHgiIHZpZXdCb3g9IjMzMi41IDIwMCAxNDAgMTQwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBmaWxsPSIjZmZmZmZmIiBkPSJNMzkyLjcyOCwzMDMuMzgybC0zMi4zODQtMjQuMjQxbC0zLjI0MywyLjQzMWMtNS41MjMsNC4xMzEtNS41MjMsMTAuODM3LDAsMTQuOTdsMzUuNjI3LDI2LjY3MiAgICBjNS41MjUsNC4xMzIsMTQuNDc4LDQuMTMyLDIwLjAwMiwwbDM1LjYyNy0yNi42NzJjNS41MjYtNC4xMzMsNS41MjYtMTAuODM5LDAtMTQuOTdsLTMuMjQ2LTIuNDMxbC0zMi4zODEsMjQuMjQxICAgIEM0MDcuMjA2LDMwNy41MTUsMzk4LjI1MywzMDcuNTE1LDM5Mi43MjgsMzAzLjM4MnoiLz4KCQk8cGF0aCBmaWxsPSIjZmZmZmZmIiBkPSJNNDQ4LjM1NywyNjEuNzQybC0zLjI0Ni0yLjQzbC0zMi4zODEsMjQuMjM4Yy01LjUyNSw0LjEzMy0xNC40NzgsNC4xMzMtMjAuMDAyLDBsLTMyLjM4NC0yNC4yMzggICAgbC0zLjI0MywyLjQzYy01LjUyMyw0LjEzMS01LjUyMywxMC44MzUsMCwxNC45NzFsMy4yNDMsMi40MjhsMzIuMzg0LDI0LjI0MWM1LjUyNSw0LjEzMywxNC40NzgsNC4xMzMsMjAuMDAyLDBsMzIuMzgxLTI0LjI0MSAgICBsMy4yNDYtMi40MjhDNDUzLjg4NCwyNzIuNTc3LDQ1My44ODQsMjY1Ljg3Myw0NDguMzU3LDI2MS43NDJ6Ii8+CgkJPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTQxMi43MywyODMuNTUxbDMyLjM4MS0yNC4yMzhsMy4yNDYtMi40MzJjNS41MjYtNC4xMzEsNS41MjYtMTAuODM3LDAtMTQuOTcxbC0yLjk4My0yLjIzMiAgICBsLTM3LjMzOCwyNy44NDNjLTIuOTMyLDIuMTk2LTcuNjg1LDIuMTk2LTEwLjYxNSwwbC0xOC45MTEtMTQuMTVjLTIuOTMxLTIuMTk1LTIuOTMxLTUuNzUyLDAtNy45NDhsMzcuOTEtMjcuNDE5bC0zLjY4OS0yLjc2MSAgICBjLTUuNTI1LTQuMTM2LTE0LjQ3OC00LjEzNi0yMC4wMDIsMGwtMzUuNjI3LDI2LjY2OGMtNS41MjMsNC4xMzMtNS41MjMsMTAuODQsMCwxNC45NzFsMy4yNDMsMi40MzJsMzIuMzg0LDI0LjIzOCAgICBDMzk4LjI1MywyODcuNjg0LDQwNy4yMDYsMjg3LjY4NCw0MTIuNzMsMjgzLjU1MXoiLz4KCTwvZz4KPC9nPgo8L3N2Zz4=&logoColor=white)](https://github.com/coil-kt/coil) -[![Room](https://img.shields.io/badge/Room-39477F?&style=for-the-badge&logo=adminer&logoColor=white)](https://d.android.com/training/data-storage/room) +[![Room Multiplatform](https://img.shields.io/badge/Room-39477F?&style=for-the-badge&logo=adminer&logoColor=white)](https://d.android.com/kotlin/multiplatform/room) [![Clean](https://img.shields.io/badge/Clean%20Architecture-4169E1.svg?style=for-the-badge&logo=ccleaner&logoColor=white)](https://d.android.com/topic/architecture) [![Dependabot](https://img.shields.io/badge/Dependabot-0366D6?&style=for-the-badge&logo=dependabot&logoColor=white)](https://github.com/dependabot) [![Github](https://img.shields.io/badge/Github%20Actions-3F464F?&style=for-the-badge&logo=github&logoColor=white)](https://github.com/michaelbel/movies/tree/develop/.github/workflows)