From ee818bc7c543e8f4b799f18b989817906ac195ab Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 18 Feb 2023 15:24:04 -0500 Subject: [PATCH] Move chapter utils to domain module --- .../kanade/domain/chapter/interactor/SyncChaptersWithSource.kt | 2 +- .../main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt | 2 +- .../java/eu/kanade/domain/history/interactor/GetNextChapters.kt | 2 +- app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt | 2 +- .../main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt | 2 +- .../main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt | 2 +- .../tachiyomi/domain/chapter/service}/ChapterRecognition.kt | 2 +- .../main/java/tachiyomi/domain/chapter/service/ChapterSort.kt | 2 +- .../tachiyomi/domain/chapter/service}/ChapterRecognitionTest.kt | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename {app/src/main/java/eu/kanade/tachiyomi/util/chapter => domain/src/main/java/tachiyomi/domain/chapter/service}/ChapterRecognition.kt (98%) rename app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterSorter.kt => domain/src/main/java/tachiyomi/domain/chapter/service/ChapterSort.kt (96%) rename {app/src/test/java/eu/kanade/tachiyomi/util/chapter => domain/src/test/java/tachiyomi/domain/chapter/service}/ChapterRecognitionTest.kt (99%) 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 d6c51ff67e..3dcd8e189d 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 @@ -10,7 +10,6 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.isLocal 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 @@ -19,6 +18,7 @@ import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.NoChaptersException import tachiyomi.domain.chapter.model.toChapterUpdate import tachiyomi.domain.chapter.repository.ChapterRepository +import tachiyomi.domain.chapter.service.ChapterRecognition 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/domain/chapter/model/ChapterFilter.kt b/app/src/main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt index 24c94c102c..4ab9399a5d 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/model/ChapterFilter.kt @@ -5,8 +5,8 @@ import eu.kanade.domain.manga.model.isLocal import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.ui.manga.ChapterItem -import eu.kanade.tachiyomi.util.chapter.getChapterSort import tachiyomi.domain.chapter.model.Chapter +import tachiyomi.domain.chapter.service.getChapterSort import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.TriStateFilter 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 18d0916847..db1a0fc14f 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,8 +1,8 @@ package eu.kanade.domain.history.interactor -import eu.kanade.tachiyomi.util.chapter.getChapterSort import tachiyomi.domain.chapter.interactor.GetChapterByMangaId import tachiyomi.domain.chapter.model.Chapter +import tachiyomi.domain.chapter.service.getChapterSort import tachiyomi.domain.history.repository.HistoryRepository import tachiyomi.domain.manga.interactor.GetManga import kotlin.math.max diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt index 03ad7c22a2..f4a7bb9c38 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt @@ -12,7 +12,6 @@ import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga -import eu.kanade.tachiyomi.util.chapter.ChapterRecognition import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.EpubFile @@ -27,6 +26,7 @@ import nl.adaptivity.xmlutil.serialization.XML import rx.Observable import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.system.logcat +import tachiyomi.domain.chapter.service.ChapterRecognition import uy.kohesive.injekt.injectLazy import java.io.File import java.io.FileInputStream 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 3368c4e810..bace084f87 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 @@ -38,7 +38,6 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.ui.manga.track.TrackItem import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences -import eu.kanade.tachiyomi.util.chapter.getChapterSort import eu.kanade.tachiyomi.util.chapter.getNextUnread import eu.kanade.tachiyomi.util.removeCovers import eu.kanade.tachiyomi.util.shouldDownloadNewChapters @@ -66,6 +65,7 @@ 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.chapter.service.getChapterSort import tachiyomi.domain.manga.interactor.GetDuplicateLibraryManga import tachiyomi.domain.manga.interactor.GetMangaWithChapters import tachiyomi.domain.manga.interactor.SetMangaChapterFlags 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 baca5c5c3c..e0261c6f5c 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 @@ -40,7 +40,6 @@ import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters import eu.kanade.tachiyomi.ui.reader.setting.OrientationType import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType -import eu.kanade.tachiyomi.util.chapter.getChapterSort import eu.kanade.tachiyomi.util.editCover import eu.kanade.tachiyomi.util.lang.byteSize import eu.kanade.tachiyomi.util.lang.takeBytes @@ -72,6 +71,7 @@ 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.chapter.service.getChapterSort import tachiyomi.domain.history.interactor.UpsertHistory import tachiyomi.domain.history.model.HistoryUpdate import tachiyomi.domain.manga.interactor.GetManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognition.kt b/domain/src/main/java/tachiyomi/domain/chapter/service/ChapterRecognition.kt similarity index 98% rename from app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognition.kt rename to domain/src/main/java/tachiyomi/domain/chapter/service/ChapterRecognition.kt index c1d16eb47e..5c009f6d2e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognition.kt +++ b/domain/src/main/java/tachiyomi/domain/chapter/service/ChapterRecognition.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util.chapter +package tachiyomi.domain.chapter.service /** * -R> = regex conversion. diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterSorter.kt b/domain/src/main/java/tachiyomi/domain/chapter/service/ChapterSort.kt similarity index 96% rename from app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterSorter.kt rename to domain/src/main/java/tachiyomi/domain/chapter/service/ChapterSort.kt index 165ac43b4d..e7f5648cba 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/chapter/ChapterSorter.kt +++ b/domain/src/main/java/tachiyomi/domain/chapter/service/ChapterSort.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util.chapter +package tachiyomi.domain.chapter.service import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga diff --git a/app/src/test/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognitionTest.kt b/domain/src/test/java/tachiyomi/domain/chapter/service/ChapterRecognitionTest.kt similarity index 99% rename from app/src/test/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognitionTest.kt rename to domain/src/test/java/tachiyomi/domain/chapter/service/ChapterRecognitionTest.kt index 022a5d461e..940d8b1de3 100644 --- a/app/src/test/java/eu/kanade/tachiyomi/util/chapter/ChapterRecognitionTest.kt +++ b/domain/src/test/java/tachiyomi/domain/chapter/service/ChapterRecognitionTest.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util.chapter +package tachiyomi.domain.chapter.service import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test