From aee785a8bbf95bd8b2ce975a25cf68dc302f363b Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 22 Jan 2023 17:44:39 +0100 Subject: [PATCH] Move more implementation to data module (#8971) --- .../java/eu/kanade/data/chapter/ChapterRepositoryImpl.kt | 2 +- app/src/main/java/eu/kanade/domain/DomainModule.kt | 6 +++--- .../java/eu/kanade/tachiyomi/data/backup/BackupManager.kt | 2 +- .../java/eu/kanade/tachiyomi/util}/BooleanExtensions.kt | 2 +- data/build.gradle.kts | 1 + .../src/main/java/tachiyomi}/data/history/HistoryMapper.kt | 2 +- .../java/tachiyomi}/data/history/HistoryRepositoryImpl.kt | 2 +- .../src/main/java/tachiyomi}/data/manga/MangaMapper.kt | 2 +- .../main/java/tachiyomi}/data/manga/MangaRepositoryImpl.kt | 4 ++-- .../src/main/java/tachiyomi}/data/updates/UpdatesMapper.kt | 2 +- .../java/tachiyomi}/data/updates/UpdatesRepositoryImpl.kt | 2 +- 11 files changed, 14 insertions(+), 13 deletions(-) rename {app/src/main/java/eu/kanade/tachiyomi/util/system => core/src/main/java/eu/kanade/tachiyomi/util}/BooleanExtensions.kt (52%) rename {app/src/main/java/eu/kanade => data/src/main/java/tachiyomi}/data/history/HistoryMapper.kt (97%) rename {app/src/main/java/eu/kanade => data/src/main/java/tachiyomi}/data/history/HistoryRepositoryImpl.kt (98%) rename {app/src/main/java/eu/kanade => data/src/main/java/tachiyomi}/data/manga/MangaMapper.kt (98%) rename {app/src/main/java/eu/kanade => data/src/main/java/tachiyomi}/data/manga/MangaRepositoryImpl.kt (98%) rename {app/src/main/java/eu/kanade => data/src/main/java/tachiyomi}/data/updates/UpdatesMapper.kt (96%) rename {app/src/main/java/eu/kanade => data/src/main/java/tachiyomi}/data/updates/UpdatesRepositoryImpl.kt (94%) diff --git a/app/src/main/java/eu/kanade/data/chapter/ChapterRepositoryImpl.kt b/app/src/main/java/eu/kanade/data/chapter/ChapterRepositoryImpl.kt index 52faab4d5..0f0f62c18 100644 --- a/app/src/main/java/eu/kanade/data/chapter/ChapterRepositoryImpl.kt +++ b/app/src/main/java/eu/kanade/data/chapter/ChapterRepositoryImpl.kt @@ -1,7 +1,7 @@ package eu.kanade.data.chapter import eu.kanade.tachiyomi.util.system.logcat -import eu.kanade.tachiyomi.util.system.toLong +import eu.kanade.tachiyomi.util.toLong import kotlinx.coroutines.flow.Flow import logcat.LogPriority import tachiyomi.data.DatabaseHandler diff --git a/app/src/main/java/eu/kanade/domain/DomainModule.kt b/app/src/main/java/eu/kanade/domain/DomainModule.kt index 9a84b61ca..f18dfe46e 100644 --- a/app/src/main/java/eu/kanade/domain/DomainModule.kt +++ b/app/src/main/java/eu/kanade/domain/DomainModule.kt @@ -1,12 +1,9 @@ package eu.kanade.domain import eu.kanade.data.chapter.ChapterRepositoryImpl -import eu.kanade.data.history.HistoryRepositoryImpl -import eu.kanade.data.manga.MangaRepositoryImpl import eu.kanade.data.source.SourceDataRepositoryImpl import eu.kanade.data.source.SourceRepositoryImpl import eu.kanade.data.track.TrackRepositoryImpl -import eu.kanade.data.updates.UpdatesRepositoryImpl import eu.kanade.domain.category.interactor.CreateCategoryWithName import eu.kanade.domain.category.interactor.DeleteCategory import eu.kanade.domain.category.interactor.GetCategories @@ -61,6 +58,9 @@ import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.repository.TrackRepository import eu.kanade.domain.updates.interactor.GetUpdates import tachiyomi.data.category.CategoryRepositoryImpl +import tachiyomi.data.history.HistoryRepositoryImpl +import tachiyomi.data.manga.MangaRepositoryImpl +import tachiyomi.data.updates.UpdatesRepositoryImpl import tachiyomi.domain.category.repository.CategoryRepository import tachiyomi.domain.chapter.repository.ChapterRepository import tachiyomi.domain.history.repository.HistoryRepository diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt index 70d65c183..f2ff2e0d6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt @@ -33,7 +33,7 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.copyFrom import eu.kanade.tachiyomi.util.system.hasPermission import eu.kanade.tachiyomi.util.system.logcat -import eu.kanade.tachiyomi.util.system.toLong +import eu.kanade.tachiyomi.util.toLong import kotlinx.serialization.protobuf.ProtoBuf import logcat.LogPriority import okio.buffer diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/BooleanExtensions.kt b/core/src/main/java/eu/kanade/tachiyomi/util/BooleanExtensions.kt similarity index 52% rename from app/src/main/java/eu/kanade/tachiyomi/util/system/BooleanExtensions.kt rename to core/src/main/java/eu/kanade/tachiyomi/util/BooleanExtensions.kt index d32476757..07c801926 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/BooleanExtensions.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/util/BooleanExtensions.kt @@ -1,3 +1,3 @@ -package eu.kanade.tachiyomi.util.system +package eu.kanade.tachiyomi.util fun Boolean.toLong() = if (this) 1L else 0L diff --git a/data/build.gradle.kts b/data/build.gradle.kts index 062405e63..24cddd932 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -22,6 +22,7 @@ android { dependencies { implementation(project(":source-api")) implementation(project(":domain")) + implementation(project(":core")) api(libs.sqldelight.android.driver) api(libs.sqldelight.coroutines) api(libs.sqldelight.android.paging) diff --git a/app/src/main/java/eu/kanade/data/history/HistoryMapper.kt b/data/src/main/java/tachiyomi/data/history/HistoryMapper.kt similarity index 97% rename from app/src/main/java/eu/kanade/data/history/HistoryMapper.kt rename to data/src/main/java/tachiyomi/data/history/HistoryMapper.kt index 0c95b27ed..c59062010 100644 --- a/app/src/main/java/eu/kanade/data/history/HistoryMapper.kt +++ b/data/src/main/java/tachiyomi/data/history/HistoryMapper.kt @@ -1,4 +1,4 @@ -package eu.kanade.data.history +package tachiyomi.data.history import tachiyomi.domain.history.model.History import tachiyomi.domain.history.model.HistoryWithRelations diff --git a/app/src/main/java/eu/kanade/data/history/HistoryRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/history/HistoryRepositoryImpl.kt similarity index 98% rename from app/src/main/java/eu/kanade/data/history/HistoryRepositoryImpl.kt rename to data/src/main/java/tachiyomi/data/history/HistoryRepositoryImpl.kt index c0c66ca29..b7d00af1d 100644 --- a/app/src/main/java/eu/kanade/data/history/HistoryRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/history/HistoryRepositoryImpl.kt @@ -1,4 +1,4 @@ -package eu.kanade.data.history +package tachiyomi.data.history import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.flow.Flow diff --git a/app/src/main/java/eu/kanade/data/manga/MangaMapper.kt b/data/src/main/java/tachiyomi/data/manga/MangaMapper.kt similarity index 98% rename from app/src/main/java/eu/kanade/data/manga/MangaMapper.kt rename to data/src/main/java/tachiyomi/data/manga/MangaMapper.kt index 2574ab82a..67248ab55 100644 --- a/app/src/main/java/eu/kanade/data/manga/MangaMapper.kt +++ b/data/src/main/java/tachiyomi/data/manga/MangaMapper.kt @@ -1,4 +1,4 @@ -package eu.kanade.data.manga +package tachiyomi.data.manga import eu.kanade.tachiyomi.source.model.UpdateStrategy import tachiyomi.domain.library.model.LibraryManga diff --git a/app/src/main/java/eu/kanade/data/manga/MangaRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/manga/MangaRepositoryImpl.kt similarity index 98% rename from app/src/main/java/eu/kanade/data/manga/MangaRepositoryImpl.kt rename to data/src/main/java/tachiyomi/data/manga/MangaRepositoryImpl.kt index 037f7d050..320759583 100644 --- a/app/src/main/java/eu/kanade/data/manga/MangaRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/manga/MangaRepositoryImpl.kt @@ -1,7 +1,7 @@ -package eu.kanade.data.manga +package tachiyomi.data.manga import eu.kanade.tachiyomi.util.system.logcat -import eu.kanade.tachiyomi.util.system.toLong +import eu.kanade.tachiyomi.util.toLong import kotlinx.coroutines.flow.Flow import logcat.LogPriority import tachiyomi.data.DatabaseHandler diff --git a/app/src/main/java/eu/kanade/data/updates/UpdatesMapper.kt b/data/src/main/java/tachiyomi/data/updates/UpdatesMapper.kt similarity index 96% rename from app/src/main/java/eu/kanade/data/updates/UpdatesMapper.kt rename to data/src/main/java/tachiyomi/data/updates/UpdatesMapper.kt index c27d7ba37..efbc55410 100644 --- a/app/src/main/java/eu/kanade/data/updates/UpdatesMapper.kt +++ b/data/src/main/java/tachiyomi/data/updates/UpdatesMapper.kt @@ -1,4 +1,4 @@ -package eu.kanade.data.updates +package tachiyomi.data.updates import tachiyomi.domain.manga.model.MangaCover import tachiyomi.domain.updates.model.UpdatesWithRelations diff --git a/app/src/main/java/eu/kanade/data/updates/UpdatesRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/updates/UpdatesRepositoryImpl.kt similarity index 94% rename from app/src/main/java/eu/kanade/data/updates/UpdatesRepositoryImpl.kt rename to data/src/main/java/tachiyomi/data/updates/UpdatesRepositoryImpl.kt index 4d0c86292..c206bd654 100644 --- a/app/src/main/java/eu/kanade/data/updates/UpdatesRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/updates/UpdatesRepositoryImpl.kt @@ -1,4 +1,4 @@ -package eu.kanade.data.updates +package tachiyomi.data.updates import kotlinx.coroutines.flow.Flow import tachiyomi.data.DatabaseHandler