From f816196df29ee9744e93470df48b2f7f24ae18f7 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 18 Feb 2023 15:14:04 -0500 Subject: [PATCH] Move more things to domain module --- .../java/eu/kanade/domain/DomainModule.kt | 40 +++++++++---------- .../interactor/SetDefaultChapterSettings.kt | 4 +- .../interactor/SyncChaptersWithSource.kt | 2 + .../SyncChaptersWithTrackServiceTwoWay.kt | 3 +- .../history/interactor/GetNextChapters.kt | 4 +- .../track/service/DelayedTrackingUpdateJob.kt | 4 +- .../tachiyomi/data/backup/BackupManager.kt | 2 +- .../tachiyomi/data/download/DownloadStore.kt | 4 +- .../tachiyomi/data/download/model/Download.kt | 4 +- .../data/library/LibraryUpdateJob.kt | 10 ++--- .../data/notification/NotificationReceiver.kt | 6 +-- .../tachiyomi/data/track/TrackService.kt | 4 +- .../kanade/tachiyomi/source/SourceManager.kt | 4 +- .../ui/browse/migration/MigrationFlags.kt | 2 +- .../manga/MigrationMangaScreenModel.kt | 2 +- .../browse/migration/search/MigrateDialog.kt | 10 ++--- .../search/MigrateSearchScreenModel.kt | 2 +- .../source/browse/BrowseSourceScreenModel.kt | 12 +++--- .../source/globalsearch/SearchScreenModel.kt | 4 +- .../ui/category/CategoryScreenModel.kt | 6 +-- .../ui/library/LibraryScreenModel.kt | 8 ++-- .../ui/manga/MangaCoverScreenModel.kt | 2 +- .../tachiyomi/ui/manga/MangaScreenModel.kt | 12 +++--- .../ui/manga/track/TrackInfoDialog.kt | 10 ++--- .../tachiyomi/ui/reader/ReaderViewModel.kt | 10 ++--- .../tachiyomi/ui/stats/StatsScreenModel.kt | 4 +- .../ui/updates/UpdatesScreenModel.kt | 6 +-- domain/build.gradle.kts | 1 + .../category/interactor/DeleteCategory.kt | 2 +- .../category/interactor/RenameCategory.kt | 2 +- .../category/interactor/ReorderCategory.kt | 2 +- .../category/interactor/SetMangaCategories.kt | 2 +- .../category/interactor/UpdateCategory.kt | 2 +- .../domain/chapter/interactor/GetChapter.kt | 2 +- .../chapter/interactor/GetChapterByMangaId.kt | 2 +- .../chapter/interactor/UpdateChapter.kt | 2 +- .../interactor/GetDuplicateLibraryManga.kt | 2 +- .../domain/manga/interactor/GetFavorites.kt | 2 +- .../manga/interactor/GetLibraryManga.kt | 2 +- .../domain/manga/interactor/GetManga.kt | 2 +- .../manga/interactor/GetMangaWithChapters.kt | 2 +- .../manga/interactor/NetworkToLocalManga.kt | 2 +- .../manga/interactor/ResetViewerFlags.kt | 2 +- .../manga/interactor/SetMangaChapterFlags.kt | 2 +- .../domain/track/interactor/DeleteTrack.kt | 2 +- .../domain/track/interactor/GetTracks.kt | 2 +- .../track/interactor/GetTracksPerManga.kt | 2 +- .../domain/track/interactor/InsertTrack.kt | 2 +- 48 files changed, 113 insertions(+), 109 deletions(-) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/category/interactor/DeleteCategory.kt (96%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/category/interactor/RenameCategory.kt (95%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/category/interactor/ReorderCategory.kt (97%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/category/interactor/SetMangaCategories.kt (90%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/category/interactor/UpdateCategory.kt (93%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/chapter/interactor/GetChapter.kt (94%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/chapter/interactor/GetChapterByMangaId.kt (92%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/chapter/interactor/UpdateChapter.kt (94%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/GetDuplicateLibraryManga.kt (88%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/GetFavorites.kt (91%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/GetLibraryManga.kt (91%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/GetManga.kt (94%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/GetMangaWithChapters.kt (95%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/NetworkToLocalManga.kt (96%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/ResetViewerFlags.kt (84%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/manga/interactor/SetMangaChapterFlags.kt (98%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/track/interactor/DeleteTrack.kt (90%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/track/interactor/GetTracks.kt (95%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/track/interactor/GetTracksPerManga.kt (92%) rename {app/src/main/java/eu/kanade => domain/src/main/java/tachiyomi}/domain/track/interactor/InsertTrack.kt (93%) diff --git a/app/src/main/java/eu/kanade/domain/DomainModule.kt b/app/src/main/java/eu/kanade/domain/DomainModule.kt index 851f8819c9..e4c39c4524 100644 --- a/app/src/main/java/eu/kanade/domain/DomainModule.kt +++ b/app/src/main/java/eu/kanade/domain/DomainModule.kt @@ -2,34 +2,18 @@ package eu.kanade.domain import eu.kanade.data.source.SourceRepositoryImpl import eu.kanade.domain.category.interactor.CreateCategoryWithName -import eu.kanade.domain.category.interactor.DeleteCategory -import eu.kanade.domain.category.interactor.RenameCategory -import eu.kanade.domain.category.interactor.ReorderCategory import eu.kanade.domain.category.interactor.ResetCategoryFlags import eu.kanade.domain.category.interactor.SetDisplayModeForCategory -import eu.kanade.domain.category.interactor.SetMangaCategories import eu.kanade.domain.category.interactor.SetSortModeForCategory -import eu.kanade.domain.category.interactor.UpdateCategory -import eu.kanade.domain.chapter.interactor.GetChapter -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId import eu.kanade.domain.chapter.interactor.SetMangaDefaultChapterFlags import eu.kanade.domain.chapter.interactor.SetReadStatus import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay -import eu.kanade.domain.chapter.interactor.UpdateChapter import eu.kanade.domain.download.interactor.DeleteDownload import eu.kanade.domain.extension.interactor.GetExtensionLanguages import eu.kanade.domain.extension.interactor.GetExtensionSources import eu.kanade.domain.extension.interactor.GetExtensionsByType import eu.kanade.domain.history.interactor.GetNextChapters -import eu.kanade.domain.manga.interactor.GetDuplicateLibraryManga -import eu.kanade.domain.manga.interactor.GetFavorites -import eu.kanade.domain.manga.interactor.GetLibraryManga -import eu.kanade.domain.manga.interactor.GetManga -import eu.kanade.domain.manga.interactor.GetMangaWithChapters -import eu.kanade.domain.manga.interactor.NetworkToLocalManga -import eu.kanade.domain.manga.interactor.ResetViewerFlags -import eu.kanade.domain.manga.interactor.SetMangaChapterFlags import eu.kanade.domain.manga.interactor.SetMangaViewerFlags import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.source.interactor.GetEnabledSources @@ -42,10 +26,6 @@ import eu.kanade.domain.source.interactor.ToggleLanguage import eu.kanade.domain.source.interactor.ToggleSource import eu.kanade.domain.source.interactor.ToggleSourcePin import eu.kanade.domain.source.repository.SourceRepository -import eu.kanade.domain.track.interactor.DeleteTrack -import eu.kanade.domain.track.interactor.GetTracks -import eu.kanade.domain.track.interactor.GetTracksPerManga -import eu.kanade.domain.track.interactor.InsertTrack import tachiyomi.data.category.CategoryRepositoryImpl import tachiyomi.data.chapter.ChapterRepositoryImpl import tachiyomi.data.history.HistoryRepositoryImpl @@ -53,17 +33,37 @@ import tachiyomi.data.manga.MangaRepositoryImpl import tachiyomi.data.source.SourceDataRepositoryImpl import tachiyomi.data.track.TrackRepositoryImpl import tachiyomi.data.updates.UpdatesRepositoryImpl +import tachiyomi.domain.category.interactor.DeleteCategory import tachiyomi.domain.category.interactor.GetCategories +import tachiyomi.domain.category.interactor.RenameCategory +import tachiyomi.domain.category.interactor.ReorderCategory +import tachiyomi.domain.category.interactor.SetMangaCategories +import tachiyomi.domain.category.interactor.UpdateCategory import tachiyomi.domain.category.repository.CategoryRepository +import tachiyomi.domain.chapter.interactor.GetChapter +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId import tachiyomi.domain.chapter.interactor.ShouldUpdateDbChapter +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.repository.ChapterRepository import tachiyomi.domain.history.interactor.GetHistory import tachiyomi.domain.history.interactor.GetTotalReadDuration import tachiyomi.domain.history.interactor.RemoveHistory import tachiyomi.domain.history.interactor.UpsertHistory import tachiyomi.domain.history.repository.HistoryRepository +import tachiyomi.domain.manga.interactor.GetDuplicateLibraryManga +import tachiyomi.domain.manga.interactor.GetFavorites +import tachiyomi.domain.manga.interactor.GetLibraryManga +import tachiyomi.domain.manga.interactor.GetManga +import tachiyomi.domain.manga.interactor.GetMangaWithChapters +import tachiyomi.domain.manga.interactor.NetworkToLocalManga +import tachiyomi.domain.manga.interactor.ResetViewerFlags +import tachiyomi.domain.manga.interactor.SetMangaChapterFlags import tachiyomi.domain.manga.repository.MangaRepository import tachiyomi.domain.source.repository.SourceDataRepository +import tachiyomi.domain.track.interactor.DeleteTrack +import tachiyomi.domain.track.interactor.GetTracks +import tachiyomi.domain.track.interactor.GetTracksPerManga +import tachiyomi.domain.track.interactor.InsertTrack import tachiyomi.domain.track.repository.TrackRepository import tachiyomi.domain.updates.interactor.GetUpdates import tachiyomi.domain.updates.repository.UpdatesRepository diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt index 761d6ae082..e5d60fe055 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt @@ -1,9 +1,9 @@ package eu.kanade.domain.chapter.interactor import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetFavorites -import eu.kanade.domain.manga.interactor.SetMangaChapterFlags import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.domain.manga.interactor.GetFavorites +import tachiyomi.domain.manga.interactor.SetMangaChapterFlags import tachiyomi.domain.manga.model.Manga class SetMangaDefaultChapterFlags( diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt index 32bb1a6003..d6c51ff67e 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithSource.kt @@ -12,7 +12,9 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.util.chapter.ChapterRecognition import tachiyomi.data.chapter.ChapterSanitizer +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId import tachiyomi.domain.chapter.interactor.ShouldUpdateDbChapter +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.NoChaptersException import tachiyomi.domain.chapter.model.toChapterUpdate diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt index ef78ac50a8..8867b19c1f 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt @@ -1,12 +1,13 @@ package eu.kanade.domain.chapter.interactor -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.tachiyomi.data.track.TrackService import logcat.LogPriority import tachiyomi.core.util.system.logcat +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.toChapterUpdate +import tachiyomi.domain.track.interactor.InsertTrack import tachiyomi.domain.track.model.Track import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/domain/history/interactor/GetNextChapters.kt b/app/src/main/java/eu/kanade/domain/history/interactor/GetNextChapters.kt index 0cc907a03e..18d0916847 100644 --- a/app/src/main/java/eu/kanade/domain/history/interactor/GetNextChapters.kt +++ b/app/src/main/java/eu/kanade/domain/history/interactor/GetNextChapters.kt @@ -1,10 +1,10 @@ package eu.kanade.domain.history.interactor -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.tachiyomi.util.chapter.getChapterSort +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.history.repository.HistoryRepository +import tachiyomi.domain.manga.interactor.GetManga import kotlin.math.max class GetNextChapters( diff --git a/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt b/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt index e20db565d2..928e0b71da 100644 --- a/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt +++ b/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt @@ -9,14 +9,14 @@ import androidx.work.NetworkType import androidx.work.OneTimeWorkRequestBuilder import androidx.work.WorkManager import androidx.work.WorkerParameters -import eu.kanade.domain.track.interactor.GetTracks -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.store.DelayedTrackingStore import eu.kanade.tachiyomi.data.track.TrackManager import logcat.LogPriority import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.system.logcat +import tachiyomi.domain.track.interactor.GetTracks +import tachiyomi.domain.track.interactor.InsertTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.concurrent.TimeUnit 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 2e794fde74..ad6cd94bd7 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 @@ -6,7 +6,6 @@ import android.net.Uri import com.hippo.unifile.UniFile import eu.kanade.domain.backup.service.BackupPreferences import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetFavorites import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.backup.BackupConst.BACKUP_CATEGORY import eu.kanade.tachiyomi.data.backup.BackupConst.BACKUP_CATEGORY_MASK @@ -45,6 +44,7 @@ import tachiyomi.data.updateStrategyAdapter import tachiyomi.domain.category.interactor.GetCategories import tachiyomi.domain.category.model.Category import tachiyomi.domain.history.model.HistoryUpdate +import tachiyomi.domain.manga.interactor.GetFavorites import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.io.FileOutputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadStore.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadStore.kt index 08962d2808..4c74459662 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadStore.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadStore.kt @@ -2,8 +2,6 @@ package eu.kanade.tachiyomi.data.download import android.content.Context import androidx.core.content.edit -import eu.kanade.domain.chapter.interactor.GetChapter -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.HttpSource @@ -12,6 +10,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json +import tachiyomi.domain.chapter.interactor.GetChapter +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/model/Download.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/model/Download.kt index a66ff11036..6d85720ff9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/model/Download.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/model/Download.kt @@ -1,7 +1,5 @@ package eu.kanade.tachiyomi.data.download.model -import eu.kanade.domain.chapter.interactor.GetChapter -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.online.HttpSource @@ -13,7 +11,9 @@ import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.emitAll import kotlinx.coroutines.flow.flow +import tachiyomi.domain.chapter.interactor.GetChapter import tachiyomi.domain.chapter.model.Chapter +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt index e0e2ad393b..6f667c2b50 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt @@ -15,18 +15,13 @@ import androidx.work.WorkManager import androidx.work.WorkQuery import androidx.work.WorkerParameters import androidx.work.workDataOf -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay import eu.kanade.domain.download.service.DownloadPreferences import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetLibraryManga -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.manga.model.copyFrom import eu.kanade.domain.manga.model.toSManga -import eu.kanade.domain.track.interactor.GetTracks -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.model.toDomainTrack import eu.kanade.tachiyomi.R @@ -70,11 +65,16 @@ import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.interactor.GetCategories import tachiyomi.domain.category.model.Category +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.NoChaptersException import tachiyomi.domain.library.model.LibraryManga +import tachiyomi.domain.manga.interactor.GetLibraryManga +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.toMangaUpdate +import tachiyomi.domain.track.interactor.GetTracks +import tachiyomi.domain.track.interactor.InsertTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.io.File diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt index 046cc48987..53b612e633 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationReceiver.kt @@ -8,10 +8,7 @@ import android.net.Uri import android.os.Build import androidx.core.content.ContextCompat import androidx.core.net.toUri -import eu.kanade.domain.chapter.interactor.GetChapter -import eu.kanade.domain.chapter.interactor.UpdateChapter import eu.kanade.domain.download.service.DownloadPreferences -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.backup.BackupRestoreService import eu.kanade.tachiyomi.data.download.DownloadManager @@ -30,8 +27,11 @@ import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.runBlocking import tachiyomi.core.Constants import tachiyomi.core.util.lang.launchIO +import tachiyomi.domain.chapter.interactor.GetChapter +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.toChapterUpdate +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt index 0d33de384f..b36a468b74 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt @@ -6,9 +6,7 @@ import androidx.annotation.ColorInt import androidx.annotation.DrawableRes import androidx.annotation.StringRes import eu.kanade.domain.base.BasePreferences -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.model.toDomainTrack import eu.kanade.domain.track.service.TrackPreferences @@ -21,6 +19,8 @@ import okhttp3.OkHttpClient import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.system.logcat +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId +import tachiyomi.domain.track.interactor.InsertTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt b/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt index a93084a33b..7fb1a96492 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/SourceManager.kt @@ -37,7 +37,7 @@ class SourceManager( private val stubSourcesMap = ConcurrentHashMap() val catalogueSources: Flow> = sourcesMapFlow.map { it.values.filterIsInstance() } - val onlineSources: Flow> = catalogueSources.map { sources -> sources.filterIsInstance() } + val onlineSources: Flow> = catalogueSources.map { it.filterIsInstance() } init { scope.launch { @@ -108,7 +108,7 @@ class SourceManager( } @Suppress("OverridingDeprecatedMember") - open inner class StubSource(private val sourceData: SourceData) : Source { + inner class StubSource(private val sourceData: SourceData) : Source { override val id: Long = sourceData.id diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationFlags.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationFlags.kt index 9890a7b386..79e3420305 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationFlags.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/MigrationFlags.kt @@ -1,11 +1,11 @@ package eu.kanade.tachiyomi.ui.browse.migration import eu.kanade.domain.manga.model.hasCustomCover -import eu.kanade.domain.track.interactor.GetTracks import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.cache.CoverCache import kotlinx.coroutines.runBlocking import tachiyomi.domain.manga.model.Manga +import tachiyomi.domain.track.interactor.GetTracks import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt index a7cd49bd12..8fcbfe0898 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.browse.migration.manga import androidx.compose.runtime.Immutable import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.coroutineScope -import eu.kanade.domain.manga.interactor.GetFavorites import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import kotlinx.coroutines.channels.Channel @@ -16,6 +15,7 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority import tachiyomi.core.util.system.logcat +import tachiyomi.domain.manga.interactor.GetFavorites import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt index b0db140a5d..bd99e253ff 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt @@ -25,15 +25,10 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.util.fastForEachIndexed import cafe.adriel.voyager.core.model.StateScreenModel -import eu.kanade.domain.category.interactor.SetMangaCategories -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource -import eu.kanade.domain.chapter.interactor.UpdateChapter import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.manga.model.hasCustomCover import eu.kanade.domain.manga.model.toSManga -import eu.kanade.domain.track.interactor.GetTracks -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.presentation.components.LoadingScreen import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.cache.CoverCache @@ -49,9 +44,14 @@ import tachiyomi.core.preference.PreferenceStore import tachiyomi.core.util.lang.launchIO import tachiyomi.core.util.lang.withUIContext import tachiyomi.domain.category.interactor.GetCategories +import tachiyomi.domain.category.interactor.SetMangaCategories +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.model.toChapterUpdate import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.MangaUpdate +import tachiyomi.domain.track.interactor.GetTracks +import tachiyomi.domain.track.interactor.InsertTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.Date diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt index 6714f308d2..c7722a0a20 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateSearchScreenModel.kt @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.ui.browse.migration.search import androidx.compose.runtime.Immutable import cafe.adriel.voyager.core.model.coroutineScope import eu.kanade.domain.base.BasePreferences -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.SourceManager @@ -11,6 +10,7 @@ import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchItemResult import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchScreenModel import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt index 27a2222d0b..1e9a3a8da6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt @@ -18,21 +18,15 @@ import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.core.prefs.CheckboxState import eu.kanade.core.prefs.asState import eu.kanade.core.prefs.mapAsCheckboxState -import eu.kanade.domain.category.interactor.SetMangaCategories -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId import eu.kanade.domain.chapter.interactor.SetMangaDefaultChapterFlags import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetDuplicateLibraryManga -import eu.kanade.domain.manga.interactor.GetManga -import eu.kanade.domain.manga.interactor.NetworkToLocalManga import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.manga.model.copyFrom import eu.kanade.domain.manga.model.toDomainManga import eu.kanade.domain.manga.model.toSManga import eu.kanade.domain.source.interactor.GetRemoteManga import eu.kanade.domain.source.service.SourcePreferences -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDomainTrack import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.track.EnhancedTrackService @@ -71,9 +65,15 @@ import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.interactor.GetCategories +import tachiyomi.domain.category.interactor.SetMangaCategories import tachiyomi.domain.category.model.Category +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId +import tachiyomi.domain.manga.interactor.GetDuplicateLibraryManga +import tachiyomi.domain.manga.interactor.GetManga +import tachiyomi.domain.manga.interactor.NetworkToLocalManga import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.toMangaUpdate +import tachiyomi.domain.track.interactor.InsertTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.Date diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt index 37977f3296..96a549d42b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt @@ -5,8 +5,6 @@ import androidx.compose.runtime.State import androidx.compose.runtime.produceState import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.coroutineScope -import eu.kanade.domain.manga.interactor.GetManga -import eu.kanade.domain.manga.interactor.NetworkToLocalManga import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.manga.model.copyFrom import eu.kanade.domain.manga.model.toDomainManga @@ -25,6 +23,8 @@ import tachiyomi.core.util.lang.awaitSingle import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.core.util.system.logcat +import tachiyomi.domain.manga.interactor.GetManga +import tachiyomi.domain.manga.interactor.NetworkToLocalManga import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.toMangaUpdate import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryScreenModel.kt index e659db769e..50b217025d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryScreenModel.kt @@ -5,16 +5,16 @@ import androidx.compose.runtime.Immutable import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.coroutineScope import eu.kanade.domain.category.interactor.CreateCategoryWithName -import eu.kanade.domain.category.interactor.DeleteCategory -import eu.kanade.domain.category.interactor.RenameCategory -import eu.kanade.domain.category.interactor.ReorderCategory import eu.kanade.tachiyomi.R import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch +import tachiyomi.domain.category.interactor.DeleteCategory import tachiyomi.domain.category.interactor.GetCategories +import tachiyomi.domain.category.interactor.RenameCategory +import tachiyomi.domain.category.interactor.ReorderCategory import tachiyomi.domain.category.model.Category import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt index 5c5e2e2e6d..279be90f60 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt @@ -16,15 +16,11 @@ import eu.kanade.core.util.fastFilterNot import eu.kanade.core.util.fastMapNotNull import eu.kanade.core.util.fastPartition import eu.kanade.domain.base.BasePreferences -import eu.kanade.domain.category.interactor.SetMangaCategories -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId import eu.kanade.domain.chapter.interactor.SetReadStatus import eu.kanade.domain.history.interactor.GetNextChapters import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetLibraryManga import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.manga.model.isLocal -import eu.kanade.domain.track.interactor.GetTracksPerManga import eu.kanade.presentation.components.SEARCH_DEBOUNCE_MILLIS import eu.kanade.presentation.library.components.LibraryToolbarTitle import eu.kanade.presentation.manga.DownloadAction @@ -53,13 +49,17 @@ import tachiyomi.core.util.lang.launchIO import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.core.util.lang.withIOContext import tachiyomi.domain.category.interactor.GetCategories +import tachiyomi.domain.category.interactor.SetMangaCategories import tachiyomi.domain.category.model.Category +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.library.model.LibraryManga import tachiyomi.domain.library.model.LibrarySort import tachiyomi.domain.library.model.sort +import tachiyomi.domain.manga.interactor.GetLibraryManga import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.MangaUpdate +import tachiyomi.domain.track.interactor.GetTracksPerManga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.text.Collator diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt index c80314b6c1..c7e8661d22 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt @@ -9,7 +9,6 @@ import cafe.adriel.voyager.core.model.coroutineScope import coil.imageLoader import coil.request.ImageRequest import coil.size.Size -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.cache.CoverCache @@ -25,6 +24,7 @@ import tachiyomi.core.util.lang.launchIO import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.system.logcat +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt index 3bb4a29062..3368c4e810 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt @@ -12,21 +12,15 @@ import eu.kanade.core.prefs.CheckboxState import eu.kanade.core.prefs.asState import eu.kanade.core.prefs.mapAsCheckboxState import eu.kanade.core.util.addOrRemove -import eu.kanade.domain.category.interactor.SetMangaCategories import eu.kanade.domain.chapter.interactor.SetMangaDefaultChapterFlags import eu.kanade.domain.chapter.interactor.SetReadStatus import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource -import eu.kanade.domain.chapter.interactor.UpdateChapter import eu.kanade.domain.download.service.DownloadPreferences import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetDuplicateLibraryManga -import eu.kanade.domain.manga.interactor.GetMangaWithChapters -import eu.kanade.domain.manga.interactor.SetMangaChapterFlags import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.manga.model.downloadedFilter import eu.kanade.domain.manga.model.isLocal import eu.kanade.domain.manga.model.toSManga -import eu.kanade.domain.track.interactor.GetTracks import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.ui.UiPreferences import eu.kanade.presentation.components.ChapterDownloadAction @@ -66,12 +60,18 @@ import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.interactor.GetCategories +import tachiyomi.domain.category.interactor.SetMangaCategories import tachiyomi.domain.category.model.Category +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.ChapterUpdate import tachiyomi.domain.chapter.model.NoChaptersException +import tachiyomi.domain.manga.interactor.GetDuplicateLibraryManga +import tachiyomi.domain.manga.interactor.GetMangaWithChapters +import tachiyomi.domain.manga.interactor.SetMangaChapterFlags import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.TriStateFilter +import tachiyomi.domain.track.interactor.GetTracks import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.text.DecimalFormat diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt index a81003d7c3..03d0c5ad87 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt @@ -37,11 +37,6 @@ import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.Navigator import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.domain.chapter.interactor.SyncChaptersWithTrackServiceTwoWay -import eu.kanade.domain.manga.interactor.GetManga -import eu.kanade.domain.manga.interactor.GetMangaWithChapters -import eu.kanade.domain.track.interactor.DeleteTrack -import eu.kanade.domain.track.interactor.GetTracks -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.model.toDomainTrack import eu.kanade.domain.ui.UiPreferences @@ -73,6 +68,11 @@ import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.system.logcat +import tachiyomi.domain.manga.interactor.GetManga +import tachiyomi.domain.manga.interactor.GetMangaWithChapters +import tachiyomi.domain.track.interactor.DeleteTrack +import tachiyomi.domain.track.interactor.GetTracks +import tachiyomi.domain.track.interactor.InsertTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.time.Instant diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt index 203bcbff1d..baca5c5c3c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt @@ -7,18 +7,13 @@ import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import eu.kanade.domain.base.BasePreferences -import eu.kanade.domain.chapter.interactor.GetChapterByMangaId -import eu.kanade.domain.chapter.interactor.UpdateChapter import eu.kanade.domain.chapter.model.toDbChapter import eu.kanade.domain.download.service.DownloadPreferences import eu.kanade.domain.history.interactor.GetNextChapters -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.domain.manga.interactor.SetMangaViewerFlags import eu.kanade.domain.manga.model.isLocal import eu.kanade.domain.manga.model.orientationType import eu.kanade.domain.manga.model.readingModeType -import eu.kanade.domain.track.interactor.GetTracks -import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.service.DelayedTrackingUpdateJob import eu.kanade.domain.track.service.TrackPreferences @@ -74,10 +69,15 @@ import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.system.logcat +import tachiyomi.domain.chapter.interactor.GetChapterByMangaId +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.model.ChapterUpdate import tachiyomi.domain.history.interactor.UpsertHistory import tachiyomi.domain.history.model.HistoryUpdate +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.manga.model.Manga +import tachiyomi.domain.track.interactor.GetTracks +import tachiyomi.domain.track.interactor.InsertTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.Date diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt index a1bcda2fcd..fc1b8b6c29 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt @@ -8,9 +8,7 @@ import eu.kanade.core.util.fastFilter import eu.kanade.core.util.fastFilterNot import eu.kanade.core.util.fastMapNotNull import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetLibraryManga import eu.kanade.domain.manga.model.isLocal -import eu.kanade.domain.track.interactor.GetTracks import eu.kanade.presentation.more.stats.StatsScreenState import eu.kanade.presentation.more.stats.data.StatsData import eu.kanade.tachiyomi.data.download.DownloadManager @@ -23,6 +21,8 @@ import kotlinx.coroutines.flow.update import tachiyomi.core.util.lang.launchIO import tachiyomi.domain.history.interactor.GetTotalReadDuration import tachiyomi.domain.library.model.LibraryManga +import tachiyomi.domain.manga.interactor.GetLibraryManga +import tachiyomi.domain.track.interactor.GetTracks import tachiyomi.domain.track.model.Track import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt index 51d800d36c..cf699a3eb6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt @@ -11,11 +11,8 @@ import cafe.adriel.voyager.core.model.coroutineScope import eu.kanade.core.prefs.asState import eu.kanade.core.util.addOrRemove import eu.kanade.core.util.insertSeparators -import eu.kanade.domain.chapter.interactor.GetChapter import eu.kanade.domain.chapter.interactor.SetReadStatus -import eu.kanade.domain.chapter.interactor.UpdateChapter import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.domain.manga.interactor.GetManga import eu.kanade.domain.ui.UiPreferences import eu.kanade.presentation.components.ChapterDownloadAction import eu.kanade.presentation.updates.UpdatesUiModel @@ -41,7 +38,10 @@ import logcat.LogPriority import tachiyomi.core.util.lang.launchIO import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.core.util.system.logcat +import tachiyomi.domain.chapter.interactor.GetChapter +import tachiyomi.domain.chapter.interactor.UpdateChapter import tachiyomi.domain.chapter.model.ChapterUpdate +import tachiyomi.domain.manga.interactor.GetManga import tachiyomi.domain.updates.interactor.GetUpdates import tachiyomi.domain.updates.model.UpdatesWithRelations import uy.kohesive.injekt.Injekt diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index 19e8d8935d..3209e11b32 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -17,6 +17,7 @@ dependencies { implementation(kotlinx.bundles.coroutines) implementation(project(":source-api")) + implementation(project(":core")) testImplementation(libs.junit) } diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/DeleteCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/DeleteCategory.kt similarity index 96% rename from app/src/main/java/eu/kanade/domain/category/interactor/DeleteCategory.kt rename to domain/src/main/java/tachiyomi/domain/category/interactor/DeleteCategory.kt index ac4216876b..e862303e19 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/DeleteCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/DeleteCategory.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.category.interactor +package tachiyomi.domain.category.interactor import logcat.LogPriority import tachiyomi.core.util.lang.withNonCancellableContext diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/RenameCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/RenameCategory.kt similarity index 95% rename from app/src/main/java/eu/kanade/domain/category/interactor/RenameCategory.kt rename to domain/src/main/java/tachiyomi/domain/category/interactor/RenameCategory.kt index 9f423966dc..2489aa6bfb 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/RenameCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/RenameCategory.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.category.interactor +package tachiyomi.domain.category.interactor import logcat.LogPriority import tachiyomi.core.util.lang.withNonCancellableContext diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/ReorderCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/ReorderCategory.kt similarity index 97% rename from app/src/main/java/eu/kanade/domain/category/interactor/ReorderCategory.kt rename to domain/src/main/java/tachiyomi/domain/category/interactor/ReorderCategory.kt index 4bbdb2fccb..4309eaae07 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/ReorderCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/ReorderCategory.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.category.interactor +package tachiyomi.domain.category.interactor import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/SetMangaCategories.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/SetMangaCategories.kt similarity index 90% rename from app/src/main/java/eu/kanade/domain/category/interactor/SetMangaCategories.kt rename to domain/src/main/java/tachiyomi/domain/category/interactor/SetMangaCategories.kt index 5ffa9e52a4..857ea272b3 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/SetMangaCategories.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/SetMangaCategories.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.category.interactor +package tachiyomi.domain.category.interactor import logcat.LogPriority import tachiyomi.core.util.system.logcat diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/UpdateCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/UpdateCategory.kt similarity index 93% rename from app/src/main/java/eu/kanade/domain/category/interactor/UpdateCategory.kt rename to domain/src/main/java/tachiyomi/domain/category/interactor/UpdateCategory.kt index d2a1cc80a1..4b9c8ebba6 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/UpdateCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/UpdateCategory.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.category.interactor +package tachiyomi.domain.category.interactor import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.domain.category.model.CategoryUpdate diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapter.kt b/domain/src/main/java/tachiyomi/domain/chapter/interactor/GetChapter.kt similarity index 94% rename from app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapter.kt rename to domain/src/main/java/tachiyomi/domain/chapter/interactor/GetChapter.kt index 175e43dbe1..99c628451a 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapter.kt +++ b/domain/src/main/java/tachiyomi/domain/chapter/interactor/GetChapter.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.chapter.interactor +package tachiyomi.domain.chapter.interactor import logcat.LogPriority import tachiyomi.core.util.system.logcat diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapterByMangaId.kt b/domain/src/main/java/tachiyomi/domain/chapter/interactor/GetChapterByMangaId.kt similarity index 92% rename from app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapterByMangaId.kt rename to domain/src/main/java/tachiyomi/domain/chapter/interactor/GetChapterByMangaId.kt index 4492b37d0d..fb73508924 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapterByMangaId.kt +++ b/domain/src/main/java/tachiyomi/domain/chapter/interactor/GetChapterByMangaId.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.chapter.interactor +package tachiyomi.domain.chapter.interactor import logcat.LogPriority import tachiyomi.core.util.system.logcat diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/UpdateChapter.kt b/domain/src/main/java/tachiyomi/domain/chapter/interactor/UpdateChapter.kt similarity index 94% rename from app/src/main/java/eu/kanade/domain/chapter/interactor/UpdateChapter.kt rename to domain/src/main/java/tachiyomi/domain/chapter/interactor/UpdateChapter.kt index 1d372711bb..150f6b2236 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/UpdateChapter.kt +++ b/domain/src/main/java/tachiyomi/domain/chapter/interactor/UpdateChapter.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.chapter.interactor +package tachiyomi.domain.chapter.interactor import logcat.LogPriority import tachiyomi.core.util.system.logcat diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/GetDuplicateLibraryManga.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetDuplicateLibraryManga.kt similarity index 88% rename from app/src/main/java/eu/kanade/domain/manga/interactor/GetDuplicateLibraryManga.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/GetDuplicateLibraryManga.kt index ab3079e165..8fd03436c8 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/GetDuplicateLibraryManga.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetDuplicateLibraryManga.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.repository.MangaRepository diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/GetFavorites.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetFavorites.kt similarity index 91% rename from app/src/main/java/eu/kanade/domain/manga/interactor/GetFavorites.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/GetFavorites.kt index 1e7bc54f7a..a158b0f38a 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/GetFavorites.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetFavorites.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import kotlinx.coroutines.flow.Flow import tachiyomi.domain.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/GetLibraryManga.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetLibraryManga.kt similarity index 91% rename from app/src/main/java/eu/kanade/domain/manga/interactor/GetLibraryManga.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/GetLibraryManga.kt index c3053ef7e5..bcafbafade 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/GetLibraryManga.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetLibraryManga.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import kotlinx.coroutines.flow.Flow import tachiyomi.domain.library.model.LibraryManga diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/GetManga.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetManga.kt similarity index 94% rename from app/src/main/java/eu/kanade/domain/manga/interactor/GetManga.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/GetManga.kt index c17ae09e7d..816dda7ace 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/GetManga.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetManga.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import kotlinx.coroutines.flow.Flow import logcat.LogPriority diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/GetMangaWithChapters.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetMangaWithChapters.kt similarity index 95% rename from app/src/main/java/eu/kanade/domain/manga/interactor/GetMangaWithChapters.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/GetMangaWithChapters.kt index c24639ba2c..189fe5c1a5 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/GetMangaWithChapters.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/GetMangaWithChapters.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/NetworkToLocalManga.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/NetworkToLocalManga.kt similarity index 96% rename from app/src/main/java/eu/kanade/domain/manga/interactor/NetworkToLocalManga.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/NetworkToLocalManga.kt index b34ff02680..5ca3fb647b 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/NetworkToLocalManga.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/NetworkToLocalManga.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.repository.MangaRepository diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/ResetViewerFlags.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/ResetViewerFlags.kt similarity index 84% rename from app/src/main/java/eu/kanade/domain/manga/interactor/ResetViewerFlags.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/ResetViewerFlags.kt index 7b05381b6d..44b546e2d4 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/ResetViewerFlags.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/ResetViewerFlags.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import tachiyomi.domain.manga.repository.MangaRepository diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaChapterFlags.kt b/domain/src/main/java/tachiyomi/domain/manga/interactor/SetMangaChapterFlags.kt similarity index 98% rename from app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaChapterFlags.kt rename to domain/src/main/java/tachiyomi/domain/manga/interactor/SetMangaChapterFlags.kt index 6c61620730..e3cacc4bf6 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/SetMangaChapterFlags.kt +++ b/domain/src/main/java/tachiyomi/domain/manga/interactor/SetMangaChapterFlags.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.manga.interactor +package tachiyomi.domain.manga.interactor import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.MangaUpdate diff --git a/app/src/main/java/eu/kanade/domain/track/interactor/DeleteTrack.kt b/domain/src/main/java/tachiyomi/domain/track/interactor/DeleteTrack.kt similarity index 90% rename from app/src/main/java/eu/kanade/domain/track/interactor/DeleteTrack.kt rename to domain/src/main/java/tachiyomi/domain/track/interactor/DeleteTrack.kt index 361658167b..9672a6586d 100644 --- a/app/src/main/java/eu/kanade/domain/track/interactor/DeleteTrack.kt +++ b/domain/src/main/java/tachiyomi/domain/track/interactor/DeleteTrack.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.track.interactor +package tachiyomi.domain.track.interactor import logcat.LogPriority import tachiyomi.core.util.system.logcat diff --git a/app/src/main/java/eu/kanade/domain/track/interactor/GetTracks.kt b/domain/src/main/java/tachiyomi/domain/track/interactor/GetTracks.kt similarity index 95% rename from app/src/main/java/eu/kanade/domain/track/interactor/GetTracks.kt rename to domain/src/main/java/tachiyomi/domain/track/interactor/GetTracks.kt index c611b9f507..018d5ffb32 100644 --- a/app/src/main/java/eu/kanade/domain/track/interactor/GetTracks.kt +++ b/domain/src/main/java/tachiyomi/domain/track/interactor/GetTracks.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.track.interactor +package tachiyomi.domain.track.interactor import kotlinx.coroutines.flow.Flow import logcat.LogPriority diff --git a/app/src/main/java/eu/kanade/domain/track/interactor/GetTracksPerManga.kt b/domain/src/main/java/tachiyomi/domain/track/interactor/GetTracksPerManga.kt similarity index 92% rename from app/src/main/java/eu/kanade/domain/track/interactor/GetTracksPerManga.kt rename to domain/src/main/java/tachiyomi/domain/track/interactor/GetTracksPerManga.kt index 4a0ba60076..9b8290d708 100644 --- a/app/src/main/java/eu/kanade/domain/track/interactor/GetTracksPerManga.kt +++ b/domain/src/main/java/tachiyomi/domain/track/interactor/GetTracksPerManga.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.track.interactor +package tachiyomi.domain.track.interactor import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map diff --git a/app/src/main/java/eu/kanade/domain/track/interactor/InsertTrack.kt b/domain/src/main/java/tachiyomi/domain/track/interactor/InsertTrack.kt similarity index 93% rename from app/src/main/java/eu/kanade/domain/track/interactor/InsertTrack.kt rename to domain/src/main/java/tachiyomi/domain/track/interactor/InsertTrack.kt index 7542cc866d..c9c95d2f16 100644 --- a/app/src/main/java/eu/kanade/domain/track/interactor/InsertTrack.kt +++ b/domain/src/main/java/tachiyomi/domain/track/interactor/InsertTrack.kt @@ -1,4 +1,4 @@ -package eu.kanade.domain.track.interactor +package tachiyomi.domain.track.interactor import logcat.LogPriority import tachiyomi.core.util.system.logcat