diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 6131e45d5..000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,35 +0,0 @@ -**PLEASE READ THIS** - -I acknowledge that: - -- I have updated: - - To the latest version of the app (stable is v0.15.3.0) - - All extensions -- I have gone through the FAQ (https://aniyomi.org/docs/faq/general) and troubleshooting guide (https://aniyomi.org/docs/guides/troubleshooting/) -- If this is an issue with an official anime extension, that I should be opening an issue in https://github.com/aniyomiorg/aniyomi-extensions -- If this is an issue with an official manga extension and this issue can be replicated in the Tachiyomi app, that I should be opening an issue in https://github.com/tachiyomiorg/extensions -- I have searched the existing issues and this is new ticket **NOT** a duplicate or related to another open or closed issue -- I will fill out the title and the information in this template - -Note that the issue will be automatically closed if you do not fill out the title or requested information. - -**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT** - ---- - -## Device information -* Aniyomi version: ? -* Android version: ? -* Device: ? - -## Steps to reproduce -1. First step -2. Second step - -## Issue/Request -? - -## Other details -Additional details and attachments. - -If you're experiencing crashes, share the crash logs from More → Settings → Advanced → Dump crash logs. diff --git a/.github/renovate.json5 b/.github/renovate.json5 index d223c827d..811481793 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -4,6 +4,7 @@ "config:base" ], "schedule": ["every sunday"], + "labels": ["Dependencies"], "packageRules": [ { // Compiler plugins are tightly coupled to Kotlin version diff --git a/.github/workflows/issue_moderator.yml b/.github/workflows/issue_moderator.yml index fa763d3aa..8b178e3f7 100644 --- a/.github/workflows/issue_moderator.yml +++ b/.github/workflows/issue_moderator.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Moderate issues - uses: tachiyomiorg/issue-moderator-action@v2 + uses: tachiyomiorg/issue-moderator-action@v2.6.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} duplicate-label: Duplicate diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ec873991f..57a45987a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -150,7 +150,7 @@ android { dependencies { implementation(projects.i18n) - implementation(projects.core) + implementation(projects.core.common) implementation(projects.coreMetadata) implementation(projects.sourceApi) implementation(projects.sourceLocal) @@ -220,7 +220,7 @@ dependencies { // Disk implementation(libs.disklrucache) implementation(libs.unifile) - implementation(libs.junrar) + implementation(libs.bundles.archive) // Preferences implementation(libs.preferencektx) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index dc27e3b1e..473a31a9b 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -75,4 +75,7 @@ ##---------------End: proguard configuration for kotlinx.serialization ---------- # XmlUtil --keep public enum nl.adaptivity.xmlutil.EventType { *; } \ No newline at end of file +-keep public enum nl.adaptivity.xmlutil.EventType { *; } + +# Apache Commons Compress +-keep class * extends org.apache.commons.compress.archivers.zip.ZipExtraField { (); } \ No newline at end of file diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png deleted file mode 100644 index 3e281980e..000000000 Binary files a/app/src/main/ic_launcher-web.png and /dev/null differ diff --git a/app/src/main/java/aniyomi/util/DataSaver.kt b/app/src/main/java/aniyomi/util/DataSaver.kt index a328a7c6e..f27c70055 100644 --- a/app/src/main/java/aniyomi/util/DataSaver.kt +++ b/app/src/main/java/aniyomi/util/DataSaver.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.online.HttpSource import okhttp3.OkHttpClient import okhttp3.Response -import tachiyomi.core.preference.Preference +import tachiyomi.core.common.preference.Preference import uy.kohesive.injekt.injectLazy interface DataSaver { diff --git a/app/src/main/java/eu/kanade/core/preference/CheckboxState.kt b/app/src/main/java/eu/kanade/core/preference/CheckboxState.kt index 6d1a75226..50e4fa85e 100644 --- a/app/src/main/java/eu/kanade/core/preference/CheckboxState.kt +++ b/app/src/main/java/eu/kanade/core/preference/CheckboxState.kt @@ -1,7 +1,7 @@ package eu.kanade.core.preference import androidx.compose.ui.state.ToggleableState -import tachiyomi.core.preference.CheckboxState +import tachiyomi.core.common.preference.CheckboxState fun CheckboxState.TriState.asToggleableState(): ToggleableState = when (this) { is CheckboxState.TriState.Exclude -> ToggleableState.Indeterminate diff --git a/app/src/main/java/eu/kanade/core/preference/PreferenceMutableState.kt b/app/src/main/java/eu/kanade/core/preference/PreferenceMutableState.kt index cb91e700a..1c7d9e761 100644 --- a/app/src/main/java/eu/kanade/core/preference/PreferenceMutableState.kt +++ b/app/src/main/java/eu/kanade/core/preference/PreferenceMutableState.kt @@ -5,7 +5,7 @@ import androidx.compose.runtime.mutableStateOf import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach -import tachiyomi.core.preference.Preference +import tachiyomi.core.common.preference.Preference class PreferenceMutableState( private val preference: Preference, diff --git a/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt b/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt index bf3e6b2fd..1b3a792ec 100644 --- a/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt +++ b/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt @@ -5,8 +5,8 @@ import android.content.pm.PackageManager import dev.icerock.moko.resources.StringResource import eu.kanade.tachiyomi.util.system.isPreviewBuildType import eu.kanade.tachiyomi.util.system.isReleaseBuildType -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore import tachiyomi.i18n.MR class BasePreferences( diff --git a/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt b/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt index 33f148e95..6dd6ef4fa 100644 --- a/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt +++ b/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt @@ -5,9 +5,9 @@ import eu.kanade.domain.base.BasePreferences.ExtensionInstaller import eu.kanade.tachiyomi.util.system.hasMiuiPackageInstaller import eu.kanade.tachiyomi.util.system.isShizukuInstalled import kotlinx.coroutines.CoroutineScope -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.getEnum +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.getEnum class ExtensionInstallerPreference( private val context: Context, diff --git a/app/src/main/java/eu/kanade/domain/download/anime/interactor/DeleteEpisodeDownload.kt b/app/src/main/java/eu/kanade/domain/download/anime/interactor/DeleteEpisodeDownload.kt index b44b10390..9c73250fd 100644 --- a/app/src/main/java/eu/kanade/domain/download/anime/interactor/DeleteEpisodeDownload.kt +++ b/app/src/main/java/eu/kanade/domain/download/anime/interactor/DeleteEpisodeDownload.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.download.anime.interactor import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode import tachiyomi.domain.source.anime.service.AnimeSourceManager diff --git a/app/src/main/java/eu/kanade/domain/download/manga/interactor/DeleteChapterDownload.kt b/app/src/main/java/eu/kanade/domain/download/manga/interactor/DeleteChapterDownload.kt index 0b74f8b1e..d6958c567 100644 --- a/app/src/main/java/eu/kanade/domain/download/manga/interactor/DeleteChapterDownload.kt +++ b/app/src/main/java/eu/kanade/domain/download/manga/interactor/DeleteChapterDownload.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.download.manga.interactor import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.domain.source.manga.service.MangaSourceManager diff --git a/app/src/main/java/eu/kanade/domain/entries/anime/model/Anime.kt b/app/src/main/java/eu/kanade/domain/entries/anime/model/Anime.kt index 789e02317..5b29a5719 100644 --- a/app/src/main/java/eu/kanade/domain/entries/anime/model/Anime.kt +++ b/app/src/main/java/eu/kanade/domain/entries/anime/model/Anime.kt @@ -3,7 +3,7 @@ package eu.kanade.domain.entries.anime.model import eu.kanade.domain.base.BasePreferences import eu.kanade.tachiyomi.animesource.model.SAnime import eu.kanade.tachiyomi.data.cache.AnimeCoverCache -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import tachiyomi.domain.entries.anime.model.Anime import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/domain/entries/manga/model/Manga.kt b/app/src/main/java/eu/kanade/domain/entries/manga/model/Manga.kt index 6bc467d65..e9f0fc305 100644 --- a/app/src/main/java/eu/kanade/domain/entries/manga/model/Manga.kt +++ b/app/src/main/java/eu/kanade/domain/entries/manga/model/Manga.kt @@ -5,9 +5,9 @@ import eu.kanade.tachiyomi.data.cache.MangaCoverCache import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode +import tachiyomi.core.common.preference.TriState import tachiyomi.core.metadata.comicinfo.ComicInfo import tachiyomi.core.metadata.comicinfo.ComicInfoPublishingStatus -import tachiyomi.core.preference.TriState import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.model.Chapter import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/domain/extension/anime/interactor/CreateAniyomiExtensionRepo.kt b/app/src/main/java/eu/kanade/domain/extension/anime/interactor/CreateAniyomiExtensionRepo.kt index 972d89156..0ebe7c7bc 100644 --- a/app/src/main/java/eu/kanade/domain/extension/anime/interactor/CreateAniyomiExtensionRepo.kt +++ b/app/src/main/java/eu/kanade/domain/extension/anime/interactor/CreateAniyomiExtensionRepo.kt @@ -2,7 +2,7 @@ package eu.kanade.domain.extension.anime.interactor import eu.kanade.domain.source.service.SourcePreferences import okhttp3.HttpUrl.Companion.toHttpUrl -import tachiyomi.core.preference.plusAssign +import tachiyomi.core.common.preference.plusAssign class CreateAnimeExtensionRepo(private val preferences: SourcePreferences) { diff --git a/app/src/main/java/eu/kanade/domain/extension/anime/interactor/DeleteAnimeExtensionRepo.kt b/app/src/main/java/eu/kanade/domain/extension/anime/interactor/DeleteAnimeExtensionRepo.kt index 1a7fa8ef1..44e9e04b2 100644 --- a/app/src/main/java/eu/kanade/domain/extension/anime/interactor/DeleteAnimeExtensionRepo.kt +++ b/app/src/main/java/eu/kanade/domain/extension/anime/interactor/DeleteAnimeExtensionRepo.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.extension.anime.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.minusAssign +import tachiyomi.core.common.preference.minusAssign class DeleteAnimeExtensionRepo(private val preferences: SourcePreferences) { diff --git a/app/src/main/java/eu/kanade/domain/extension/anime/interactor/TrustAnimeExtension.kt b/app/src/main/java/eu/kanade/domain/extension/anime/interactor/TrustAnimeExtension.kt index 16aaa4a73..2cf6cd99d 100644 --- a/app/src/main/java/eu/kanade/domain/extension/anime/interactor/TrustAnimeExtension.kt +++ b/app/src/main/java/eu/kanade/domain/extension/anime/interactor/TrustAnimeExtension.kt @@ -3,7 +3,7 @@ package eu.kanade.domain.extension.anime.interactor import android.content.pm.PackageInfo import androidx.core.content.pm.PackageInfoCompat import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet class TrustAnimeExtension( private val preferences: SourcePreferences, diff --git a/app/src/main/java/eu/kanade/domain/extension/manga/interactor/CreateMangaExtensionRepo.kt b/app/src/main/java/eu/kanade/domain/extension/manga/interactor/CreateMangaExtensionRepo.kt index 379880097..4a9d6164c 100644 --- a/app/src/main/java/eu/kanade/domain/extension/manga/interactor/CreateMangaExtensionRepo.kt +++ b/app/src/main/java/eu/kanade/domain/extension/manga/interactor/CreateMangaExtensionRepo.kt @@ -2,7 +2,7 @@ package eu.kanade.domain.extension.manga.interactor import eu.kanade.domain.source.service.SourcePreferences import okhttp3.HttpUrl.Companion.toHttpUrl -import tachiyomi.core.preference.plusAssign +import tachiyomi.core.common.preference.plusAssign class CreateMangaExtensionRepo(private val preferences: SourcePreferences) { diff --git a/app/src/main/java/eu/kanade/domain/extension/manga/interactor/DeleteMangaExtensionRepo.kt b/app/src/main/java/eu/kanade/domain/extension/manga/interactor/DeleteMangaExtensionRepo.kt index 2279a52ab..5f8a0c9c5 100644 --- a/app/src/main/java/eu/kanade/domain/extension/manga/interactor/DeleteMangaExtensionRepo.kt +++ b/app/src/main/java/eu/kanade/domain/extension/manga/interactor/DeleteMangaExtensionRepo.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.extension.manga.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.minusAssign +import tachiyomi.core.common.preference.minusAssign class DeleteMangaExtensionRepo(private val preferences: SourcePreferences) { diff --git a/app/src/main/java/eu/kanade/domain/extension/manga/interactor/TrustMangaExtension.kt b/app/src/main/java/eu/kanade/domain/extension/manga/interactor/TrustMangaExtension.kt index 48d46b58b..daa5fb863 100644 --- a/app/src/main/java/eu/kanade/domain/extension/manga/interactor/TrustMangaExtension.kt +++ b/app/src/main/java/eu/kanade/domain/extension/manga/interactor/TrustMangaExtension.kt @@ -3,7 +3,7 @@ package eu.kanade.domain.extension.manga.interactor import android.content.pm.PackageInfo import androidx.core.content.pm.PackageInfoCompat import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet class TrustMangaExtension( private val preferences: SourcePreferences, diff --git a/app/src/main/java/eu/kanade/domain/items/chapter/interactor/SetReadStatus.kt b/app/src/main/java/eu/kanade/domain/items/chapter/interactor/SetReadStatus.kt index e4ff2d50f..72a391990 100644 --- a/app/src/main/java/eu/kanade/domain/items/chapter/interactor/SetReadStatus.kt +++ b/app/src/main/java/eu/kanade/domain/items/chapter/interactor/SetReadStatus.kt @@ -2,8 +2,8 @@ package eu.kanade.domain.items.chapter.interactor import eu.kanade.domain.download.manga.interactor.DeleteChapterDownload import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.entries.manga.repository.MangaRepository diff --git a/app/src/main/java/eu/kanade/domain/items/episode/interactor/SetSeenStatus.kt b/app/src/main/java/eu/kanade/domain/items/episode/interactor/SetSeenStatus.kt index 348473991..33a3c6d75 100644 --- a/app/src/main/java/eu/kanade/domain/items/episode/interactor/SetSeenStatus.kt +++ b/app/src/main/java/eu/kanade/domain/items/episode/interactor/SetSeenStatus.kt @@ -2,8 +2,8 @@ package eu.kanade.domain.items.episode.interactor import eu.kanade.domain.download.anime.interactor.DeleteEpisodeDownload import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.entries.anime.repository.AnimeRepository diff --git a/app/src/main/java/eu/kanade/domain/source/anime/interactor/GetAnimeSourcesWithFavoriteCount.kt b/app/src/main/java/eu/kanade/domain/source/anime/interactor/GetAnimeSourcesWithFavoriteCount.kt index 03fcc11b5..f59272e65 100644 --- a/app/src/main/java/eu/kanade/domain/source/anime/interactor/GetAnimeSourcesWithFavoriteCount.kt +++ b/app/src/main/java/eu/kanade/domain/source/anime/interactor/GetAnimeSourcesWithFavoriteCount.kt @@ -4,7 +4,7 @@ import eu.kanade.domain.source.interactor.SetMigrateSorting import eu.kanade.domain.source.service.SourcePreferences import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine -import tachiyomi.core.util.lang.compareToWithCollator +import tachiyomi.core.common.util.lang.compareToWithCollator import tachiyomi.domain.source.anime.model.AnimeSource import tachiyomi.domain.source.anime.repository.AnimeSourceRepository import tachiyomi.source.local.entries.anime.LocalAnimeSource diff --git a/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSource.kt b/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSource.kt index 00dae0a83..1d5cd56a9 100644 --- a/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSource.kt +++ b/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSource.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.anime.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet import tachiyomi.domain.source.anime.model.AnimeSource class ToggleAnimeSource( diff --git a/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSourcePin.kt b/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSourcePin.kt index d50e0b8fa..793cbb7d0 100644 --- a/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSourcePin.kt +++ b/app/src/main/java/eu/kanade/domain/source/anime/interactor/ToggleAnimeSourcePin.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.anime.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet import tachiyomi.domain.source.anime.model.AnimeSource class ToggleAnimeSourcePin( diff --git a/app/src/main/java/eu/kanade/domain/source/interactor/ToggleLanguage.kt b/app/src/main/java/eu/kanade/domain/source/interactor/ToggleLanguage.kt index bc601117b..c813890d2 100644 --- a/app/src/main/java/eu/kanade/domain/source/interactor/ToggleLanguage.kt +++ b/app/src/main/java/eu/kanade/domain/source/interactor/ToggleLanguage.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet class ToggleLanguage( val preferences: SourcePreferences, diff --git a/app/src/main/java/eu/kanade/domain/source/manga/interactor/GetMangaSourcesWithFavoriteCount.kt b/app/src/main/java/eu/kanade/domain/source/manga/interactor/GetMangaSourcesWithFavoriteCount.kt index 8b9b03d97..cd6af6418 100644 --- a/app/src/main/java/eu/kanade/domain/source/manga/interactor/GetMangaSourcesWithFavoriteCount.kt +++ b/app/src/main/java/eu/kanade/domain/source/manga/interactor/GetMangaSourcesWithFavoriteCount.kt @@ -4,7 +4,7 @@ import eu.kanade.domain.source.interactor.SetMigrateSorting import eu.kanade.domain.source.service.SourcePreferences import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine -import tachiyomi.core.util.lang.compareToWithCollator +import tachiyomi.core.common.util.lang.compareToWithCollator import tachiyomi.domain.source.manga.model.Source import tachiyomi.domain.source.manga.repository.MangaSourceRepository import tachiyomi.source.local.entries.manga.LocalMangaSource diff --git a/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleExcludeFromMangaDataSaver.kt b/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleExcludeFromMangaDataSaver.kt index 409f8a8ba..0eaabe274 100644 --- a/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleExcludeFromMangaDataSaver.kt +++ b/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleExcludeFromMangaDataSaver.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.manga.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet import tachiyomi.domain.source.manga.model.Source class ToggleExcludeFromMangaDataSaver( diff --git a/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSource.kt b/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSource.kt index 8b12d1c6c..0b53bf13e 100644 --- a/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSource.kt +++ b/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSource.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.manga.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet import tachiyomi.domain.source.manga.model.Source class ToggleMangaSource( diff --git a/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSourcePin.kt b/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSourcePin.kt index 4a6c80a18..90a4d44d7 100644 --- a/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSourcePin.kt +++ b/app/src/main/java/eu/kanade/domain/source/manga/interactor/ToggleMangaSourcePin.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.manga.interactor import eu.kanade.domain.source.service.SourcePreferences -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet import tachiyomi.domain.source.manga.model.Source class ToggleMangaSourcePin( diff --git a/app/src/main/java/eu/kanade/domain/source/service/SourcePreferences.kt b/app/src/main/java/eu/kanade/domain/source/service/SourcePreferences.kt index 8f789482a..538571678 100644 --- a/app/src/main/java/eu/kanade/domain/source/service/SourcePreferences.kt +++ b/app/src/main/java/eu/kanade/domain/source/service/SourcePreferences.kt @@ -2,9 +2,9 @@ package eu.kanade.domain.source.service import eu.kanade.domain.source.interactor.SetMigrateSorting import eu.kanade.tachiyomi.util.system.LocaleHelper -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.getEnum +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.getEnum import tachiyomi.domain.library.model.LibraryDisplayMode class SourcePreferences( diff --git a/app/src/main/java/eu/kanade/domain/track/anime/interactor/AddAnimeTracks.kt b/app/src/main/java/eu/kanade/domain/track/anime/interactor/AddAnimeTracks.kt index 003e43c0a..91dd332a0 100644 --- a/app/src/main/java/eu/kanade/domain/track/anime/interactor/AddAnimeTracks.kt +++ b/app/src/main/java/eu/kanade/domain/track/anime/interactor/AddAnimeTracks.kt @@ -9,9 +9,9 @@ import eu.kanade.tachiyomi.data.track.EnhancedAnimeTracker import eu.kanade.tachiyomi.data.track.Tracker import eu.kanade.tachiyomi.util.lang.convertEpochMillisZone import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.history.anime.interactor.GetAnimeHistory import tachiyomi.domain.items.episode.interactor.GetEpisodesByAnimeId diff --git a/app/src/main/java/eu/kanade/domain/track/anime/interactor/SyncEpisodeProgressWithTrack.kt b/app/src/main/java/eu/kanade/domain/track/anime/interactor/SyncEpisodeProgressWithTrack.kt index ab1087f11..cf2c56aee 100644 --- a/app/src/main/java/eu/kanade/domain/track/anime/interactor/SyncEpisodeProgressWithTrack.kt +++ b/app/src/main/java/eu/kanade/domain/track/anime/interactor/SyncEpisodeProgressWithTrack.kt @@ -4,7 +4,7 @@ import eu.kanade.domain.track.anime.model.toDbTrack import eu.kanade.tachiyomi.data.track.AnimeTracker import eu.kanade.tachiyomi.data.track.EnhancedAnimeTracker import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.episode.interactor.GetEpisodesByAnimeId import tachiyomi.domain.items.episode.interactor.UpdateEpisode import tachiyomi.domain.items.episode.model.toEpisodeUpdate diff --git a/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt b/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt index da83d448c..4c97f4571 100644 --- a/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt +++ b/app/src/main/java/eu/kanade/domain/track/anime/interactor/TrackEpisode.kt @@ -10,8 +10,8 @@ import eu.kanade.tachiyomi.util.system.isOnline import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.anime.interactor.GetAnimeTracks import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack @@ -22,7 +22,7 @@ class TrackEpisode( private val delayedTrackingStore: DelayedAnimeTrackingStore, ) { - suspend fun await(context: Context, animeId: Long, episodeNumber: Double) { + suspend fun await(context: Context, animeId: Long, episodeNumber: Double, setupJobOnFailure: Boolean = true) { withNonCancellableContext { val tracks = getTracks.await(animeId) if (tracks.isEmpty()) return@withNonCancellableContext @@ -44,7 +44,9 @@ class TrackEpisode( delayedTrackingStore.removeAnimeItem(track.id) } else { delayedTrackingStore.addAnime(track.id, episodeNumber) - DelayedAnimeTrackingUpdateJob.setupTask(context) + if (setupJobOnFailure) { + DelayedAnimeTrackingUpdateJob.setupTask(context) + } } } } diff --git a/app/src/main/java/eu/kanade/domain/track/anime/service/DelayedAnimeTrackingUpdateJob.kt b/app/src/main/java/eu/kanade/domain/track/anime/service/DelayedAnimeTrackingUpdateJob.kt index f916940d5..0cb7b11a9 100644 --- a/app/src/main/java/eu/kanade/domain/track/anime/service/DelayedAnimeTrackingUpdateJob.kt +++ b/app/src/main/java/eu/kanade/domain/track/anime/service/DelayedAnimeTrackingUpdateJob.kt @@ -12,8 +12,8 @@ import eu.kanade.domain.track.anime.interactor.TrackEpisode import eu.kanade.domain.track.anime.store.DelayedAnimeTrackingStore import eu.kanade.tachiyomi.util.system.workManager import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.anime.interactor.GetAnimeTracks import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -47,7 +47,12 @@ class DelayedAnimeTrackingUpdateJob(private val context: Context, workerParams: "Updating delayed track item: ${animeTrack.animeId}" + ", last chapter read: ${animeTrack.lastEpisodeSeen}" } - trackEpisode.await(context, animeTrack.animeId, animeTrack.lastEpisodeSeen) + trackEpisode.await( + context, + animeTrack.animeId, + animeTrack.lastEpisodeSeen, + setupJobOnFailure = false, + ) } } diff --git a/app/src/main/java/eu/kanade/domain/track/anime/store/DelayedAnimeTrackingStore.kt b/app/src/main/java/eu/kanade/domain/track/anime/store/DelayedAnimeTrackingStore.kt index 350b97906..259b50909 100644 --- a/app/src/main/java/eu/kanade/domain/track/anime/store/DelayedAnimeTrackingStore.kt +++ b/app/src/main/java/eu/kanade/domain/track/anime/store/DelayedAnimeTrackingStore.kt @@ -3,7 +3,7 @@ package eu.kanade.domain.track.anime.store import android.content.Context import androidx.core.content.edit import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat class DelayedAnimeTrackingStore(context: Context) { diff --git a/app/src/main/java/eu/kanade/domain/track/manga/interactor/AddMangaTracks.kt b/app/src/main/java/eu/kanade/domain/track/manga/interactor/AddMangaTracks.kt index cde8b66fd..fdcd7fba3 100644 --- a/app/src/main/java/eu/kanade/domain/track/manga/interactor/AddMangaTracks.kt +++ b/app/src/main/java/eu/kanade/domain/track/manga/interactor/AddMangaTracks.kt @@ -9,9 +9,9 @@ import eu.kanade.tachiyomi.data.track.Tracker import eu.kanade.tachiyomi.source.MangaSource import eu.kanade.tachiyomi.util.lang.convertEpochMillisZone import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.history.manga.interactor.GetMangaHistory import tachiyomi.domain.items.chapter.interactor.GetChaptersByMangaId diff --git a/app/src/main/java/eu/kanade/domain/track/manga/interactor/SyncChapterProgressWithTrack.kt b/app/src/main/java/eu/kanade/domain/track/manga/interactor/SyncChapterProgressWithTrack.kt index 53c92707c..ab36ce46f 100644 --- a/app/src/main/java/eu/kanade/domain/track/manga/interactor/SyncChapterProgressWithTrack.kt +++ b/app/src/main/java/eu/kanade/domain/track/manga/interactor/SyncChapterProgressWithTrack.kt @@ -4,7 +4,7 @@ import eu.kanade.domain.track.manga.model.toDbTrack import eu.kanade.tachiyomi.data.track.EnhancedMangaTracker import eu.kanade.tachiyomi.data.track.MangaTracker import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.chapter.interactor.GetChaptersByMangaId import tachiyomi.domain.items.chapter.interactor.UpdateChapter import tachiyomi.domain.items.chapter.model.toChapterUpdate diff --git a/app/src/main/java/eu/kanade/domain/track/manga/interactor/TrackChapter.kt b/app/src/main/java/eu/kanade/domain/track/manga/interactor/TrackChapter.kt index 092e0ff34..79f34fff2 100644 --- a/app/src/main/java/eu/kanade/domain/track/manga/interactor/TrackChapter.kt +++ b/app/src/main/java/eu/kanade/domain/track/manga/interactor/TrackChapter.kt @@ -9,8 +9,8 @@ import eu.kanade.tachiyomi.data.track.TrackerManager import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.manga.interactor.GetMangaTracks import tachiyomi.domain.track.manga.interactor.InsertMangaTrack @@ -21,7 +21,7 @@ class TrackChapter( private val delayedTrackingStore: DelayedMangaTrackingStore, ) { - suspend fun await(context: Context, mangaId: Long, chapterNumber: Double) { + suspend fun await(context: Context, mangaId: Long, chapterNumber: Double, setupJobOnFailure: Boolean = true) { withNonCancellableContext { val tracks = getTracks.await(mangaId) if (tracks.isEmpty()) return@withNonCancellableContext @@ -45,7 +45,9 @@ class TrackChapter( delayedTrackingStore.removeMangaItem(track.id) } catch (e: Exception) { delayedTrackingStore.addManga(track.id, chapterNumber) - DelayedMangaTrackingUpdateJob.setupTask(context) + if (setupJobOnFailure) { + DelayedMangaTrackingUpdateJob.setupTask(context) + } throw e } } diff --git a/app/src/main/java/eu/kanade/domain/track/manga/service/DelayedMangaTrackingUpdateJob.kt b/app/src/main/java/eu/kanade/domain/track/manga/service/DelayedMangaTrackingUpdateJob.kt index 7ed280a8b..58e3b4988 100644 --- a/app/src/main/java/eu/kanade/domain/track/manga/service/DelayedMangaTrackingUpdateJob.kt +++ b/app/src/main/java/eu/kanade/domain/track/manga/service/DelayedMangaTrackingUpdateJob.kt @@ -12,8 +12,8 @@ import eu.kanade.domain.track.manga.interactor.TrackChapter import eu.kanade.domain.track.manga.store.DelayedMangaTrackingStore import eu.kanade.tachiyomi.util.system.workManager import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.manga.interactor.GetMangaTracks import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -45,7 +45,7 @@ class DelayedMangaTrackingUpdateJob(private val context: Context, workerParams: logcat(LogPriority.DEBUG) { "Updating delayed track item: ${track.mangaId}, last chapter read: ${track.lastChapterRead}" } - trackChapter.await(context, track.mangaId, track.lastChapterRead) + trackChapter.await(context, track.mangaId, track.lastChapterRead, setupJobOnFailure = false) } } diff --git a/app/src/main/java/eu/kanade/domain/track/manga/store/DelayedMangaTrackingStore.kt b/app/src/main/java/eu/kanade/domain/track/manga/store/DelayedMangaTrackingStore.kt index 4784e0e20..169979da1 100644 --- a/app/src/main/java/eu/kanade/domain/track/manga/store/DelayedMangaTrackingStore.kt +++ b/app/src/main/java/eu/kanade/domain/track/manga/store/DelayedMangaTrackingStore.kt @@ -3,7 +3,7 @@ package eu.kanade.domain.track.manga.store import android.content.Context import androidx.core.content.edit import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat class DelayedMangaTrackingStore(context: Context) { diff --git a/app/src/main/java/eu/kanade/domain/track/service/TrackPreferences.kt b/app/src/main/java/eu/kanade/domain/track/service/TrackPreferences.kt index 8db204b6b..81b3f01d1 100644 --- a/app/src/main/java/eu/kanade/domain/track/service/TrackPreferences.kt +++ b/app/src/main/java/eu/kanade/domain/track/service/TrackPreferences.kt @@ -2,8 +2,8 @@ package eu.kanade.domain.track.service import eu.kanade.tachiyomi.data.track.Tracker import eu.kanade.tachiyomi.data.track.anilist.Anilist -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore class TrackPreferences( private val preferenceStore: PreferenceStore, diff --git a/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt b/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt index 949483dc4..e54886b45 100644 --- a/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt +++ b/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt @@ -7,10 +7,10 @@ import eu.kanade.domain.ui.model.TabletUiMode import eu.kanade.domain.ui.model.ThemeMode import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.isDynamicColorAvailable -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.getEnum -import java.text.DateFormat -import java.text.SimpleDateFormat +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.getEnum +import java.time.format.DateTimeFormatter +import java.time.format.FormatStyle import java.util.Locale class UiPreferences( @@ -37,9 +37,9 @@ class UiPreferences( fun navStyle() = preferenceStore.getEnum("bottom_rail_nav_style", NavStyle.MOVE_HISTORY_TO_MORE) companion object { - fun dateFormat(format: String): DateFormat = when (format) { - "" -> DateFormat.getDateInstance(DateFormat.SHORT) - else -> SimpleDateFormat(format, Locale.getDefault()) + fun dateFormat(format: String): DateTimeFormatter = when (format) { + "" -> DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT) + else -> DateTimeFormatter.ofPattern(format, Locale.getDefault()) } } } diff --git a/app/src/main/java/eu/kanade/presentation/browse/anime/AnimeExtensionDetailsScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/anime/AnimeExtensionDetailsScreen.kt index 3ec02f90a..6b88b6943 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/anime/AnimeExtensionDetailsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/anime/AnimeExtensionDetailsScreen.kt @@ -52,6 +52,7 @@ import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource import eu.kanade.tachiyomi.extension.anime.model.AnimeExtension import eu.kanade.tachiyomi.ui.browse.anime.extension.details.AnimeExtensionDetailsScreenModel import eu.kanade.tachiyomi.util.system.LocaleHelper +import eu.kanade.tachiyomi.util.system.copyToClipboard import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf import tachiyomi.i18n.MR @@ -223,7 +224,31 @@ private fun DetailsHeader( end = MaterialTheme.padding.medium, top = MaterialTheme.padding.medium, bottom = MaterialTheme.padding.small, - ), + ) + .clickable { + val extDebugInfo = buildString { + append( + """ + Extension name: ${extension.name} (lang: ${extension.lang}; package: ${extension.pkgName}) + Extension version: ${extension.versionName} (lib: ${extension.libVersion}; version code: ${extension.versionCode}) + NSFW: ${extension.isNsfw} + """.trimIndent(), + ) + + if (extension is AnimeExtension.Installed) { + append("\n\n") + append( + """ + Update available: ${extension.hasUpdate} + Obsolete: ${extension.isObsolete} + Shared: ${extension.isShared} + Repository: ${extension.repoUrl} + """.trimIndent(), + ) + } + } + context.copyToClipboard("Extension Debug information", extDebugInfo) + }, horizontalAlignment = Alignment.CenterHorizontally, ) { AnimeExtensionIcon( diff --git a/app/src/main/java/eu/kanade/presentation/browse/anime/BrowseAnimeSourceScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/anime/BrowseAnimeSourceScreen.kt index 9bf34e2b4..5e66204b6 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/anime/BrowseAnimeSourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/anime/BrowseAnimeSourceScreen.kt @@ -24,7 +24,7 @@ import eu.kanade.presentation.util.formattedMessage import eu.kanade.tachiyomi.animesource.AnimeSource import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.flow.StateFlow -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.source.anime.model.StubAnimeSource diff --git a/app/src/main/java/eu/kanade/presentation/browse/anime/components/BrowseAnimeIcons.kt b/app/src/main/java/eu/kanade/presentation/browse/anime/components/BrowseAnimeIcons.kt index 54fc79767..1bd0a3eaa 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/anime/components/BrowseAnimeIcons.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/anime/components/BrowseAnimeIcons.kt @@ -31,7 +31,7 @@ import eu.kanade.presentation.util.rememberResourceBitmapPainter import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.extension.anime.model.AnimeExtension import eu.kanade.tachiyomi.extension.anime.util.AnimeExtensionLoader -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.source.anime.model.AnimeSource import tachiyomi.source.local.entries.anime.LocalAnimeSource diff --git a/app/src/main/java/eu/kanade/presentation/browse/manga/BrowseMangaSourceScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/manga/BrowseMangaSourceScreen.kt index 08d7c8868..694f92661 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/manga/BrowseMangaSourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/manga/BrowseMangaSourceScreen.kt @@ -24,7 +24,7 @@ import eu.kanade.presentation.util.formattedMessage import eu.kanade.tachiyomi.source.MangaSource import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.flow.StateFlow -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.source.manga.model.StubMangaSource diff --git a/app/src/main/java/eu/kanade/presentation/browse/manga/MangaExtensionDetailsScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/manga/MangaExtensionDetailsScreen.kt index 3cd1eae64..7b9a75535 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/manga/MangaExtensionDetailsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/manga/MangaExtensionDetailsScreen.kt @@ -53,6 +53,7 @@ import eu.kanade.tachiyomi.extension.manga.model.MangaExtension import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.ui.browse.manga.extension.details.MangaExtensionDetailsScreenModel import eu.kanade.tachiyomi.util.system.LocaleHelper +import eu.kanade.tachiyomi.util.system.copyToClipboard import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf import tachiyomi.i18n.MR @@ -224,7 +225,31 @@ private fun DetailsHeader( end = MaterialTheme.padding.medium, top = MaterialTheme.padding.medium, bottom = MaterialTheme.padding.small, - ), + ) + .clickable { + val extDebugInfo = buildString { + append( + """ + Extension name: ${extension.name} (lang: ${extension.lang}; package: ${extension.pkgName}) + Extension version: ${extension.versionName} (lib: ${extension.libVersion}; version code: ${extension.versionCode}) + NSFW: ${extension.isNsfw} + """.trimIndent(), + ) + + if (extension is MangaExtension.Installed) { + append("\n\n") + append( + """ + Update available: ${extension.hasUpdate} + Obsolete: ${extension.isObsolete} + Shared: ${extension.isShared} + Repository: ${extension.repoUrl} + """.trimIndent(), + ) + } + } + context.copyToClipboard("Extension Debug information", extDebugInfo) + }, horizontalAlignment = Alignment.CenterHorizontally, ) { MangaExtensionIcon( diff --git a/app/src/main/java/eu/kanade/presentation/browse/manga/components/BrowseMangaIcons.kt b/app/src/main/java/eu/kanade/presentation/browse/manga/components/BrowseMangaIcons.kt index e994d1ec2..4b1757d4a 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/manga/components/BrowseMangaIcons.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/manga/components/BrowseMangaIcons.kt @@ -31,7 +31,7 @@ import eu.kanade.presentation.util.rememberResourceBitmapPainter import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.extension.manga.model.MangaExtension import eu.kanade.tachiyomi.extension.manga.util.MangaExtensionLoader -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.source.manga.model.Source import tachiyomi.source.local.entries.manga.LocalMangaSource diff --git a/app/src/main/java/eu/kanade/presentation/category/CategoryExtensions.kt b/app/src/main/java/eu/kanade/presentation/category/CategoryExtensions.kt index a6c22c240..62c85907d 100644 --- a/app/src/main/java/eu/kanade/presentation/category/CategoryExtensions.kt +++ b/app/src/main/java/eu/kanade/presentation/category/CategoryExtensions.kt @@ -2,7 +2,7 @@ package eu.kanade.presentation.category import android.content.Context import androidx.compose.runtime.Composable -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.category.model.Category import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt b/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt index fd6396b95..7709d960f 100644 --- a/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt +++ b/app/src/main/java/eu/kanade/presentation/category/components/CategoryDialogs.kt @@ -30,7 +30,7 @@ import eu.kanade.presentation.category.visualName import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.delay -import tachiyomi.core.preference.CheckboxState +import tachiyomi.core.common.preference.CheckboxState import tachiyomi.domain.category.model.Category import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.padding diff --git a/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt b/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt index 0d11854aa..fac8bb989 100644 --- a/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt +++ b/app/src/main/java/eu/kanade/presentation/components/AdaptiveSheet.kt @@ -106,5 +106,5 @@ fun AdaptiveSheet( private val dialogProperties = DialogProperties( usePlatformDefaultWidth = false, - decorFitsSystemWindows = false, + decorFitsSystemWindows = true, ) diff --git a/app/src/main/java/eu/kanade/presentation/components/DateText.kt b/app/src/main/java/eu/kanade/presentation/components/DateText.kt index 9fa8c85d1..4f2d988af 100644 --- a/app/src/main/java/eu/kanade/presentation/components/DateText.kt +++ b/app/src/main/java/eu/kanade/presentation/components/DateText.kt @@ -9,20 +9,26 @@ import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.util.Date +import java.time.Instant +import java.time.LocalDate +import java.time.ZoneId @Composable fun relativeDateText( dateEpochMillis: Long, ): String { return relativeDateText( - date = Date(dateEpochMillis).takeIf { dateEpochMillis > 0L }, + localDate = LocalDate.ofInstant( + Instant.ofEpochMilli(dateEpochMillis), + ZoneId.systemDefault(), + ) + .takeIf { dateEpochMillis > 0L }, ) } @Composable fun relativeDateText( - date: Date?, + localDate: LocalDate?, ): String { val context = LocalContext.current @@ -30,11 +36,10 @@ fun relativeDateText( val relativeTime = remember { preferences.relativeTime().get() } val dateFormat = remember { UiPreferences.dateFormat(preferences.dateFormat().get()) } - return date - ?.toRelativeString( - context = context, - relative = relativeTime, - dateFormat = dateFormat, - ) + return localDate?.toRelativeString( + context = context, + relative = relativeTime, + dateFormat = dateFormat, + ) ?: stringResource(MR.strings.not_applicable) } diff --git a/app/src/main/java/eu/kanade/presentation/components/ItemDownloadIndicator.kt b/app/src/main/java/eu/kanade/presentation/components/ItemDownloadIndicator.kt index 7c8f263fd..1bf74f6b2 100644 --- a/app/src/main/java/eu/kanade/presentation/components/ItemDownloadIndicator.kt +++ b/app/src/main/java/eu/kanade/presentation/components/ItemDownloadIndicator.kt @@ -4,7 +4,7 @@ import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material.ripple.rememberRipple +import androidx.compose.material.ripple import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.composed @@ -32,7 +32,7 @@ internal fun Modifier.commonClickable( onClick = onClick, role = Role.Button, interactionSource = remember { MutableInteractionSource() }, - indication = rememberRipple( + indication = ripple( bounded = false, radius = IconButtonTokens.StateLayerSize / 2, ), diff --git a/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeOptionsDialogScreen.kt b/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeOptionsDialogScreen.kt index b2c812a2a..f671671c5 100644 --- a/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeOptionsDialogScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeOptionsDialogScreen.kt @@ -59,9 +59,9 @@ import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.lang.launchUI -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchUI +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.interactor.GetAnime import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.interactor.GetEpisode diff --git a/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeSettingsDialog.kt b/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeSettingsDialog.kt index ec05ef74a..5c9f101d0 100644 --- a/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeSettingsDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/entries/anime/EpisodeSettingsDialog.kt @@ -22,7 +22,7 @@ import eu.kanade.domain.entries.anime.model.forceDownloaded import eu.kanade.presentation.components.TabbedDialog import eu.kanade.presentation.components.TabbedDialogPaddings import kotlinx.collections.immutable.persistentListOf -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.LabeledCheckbox diff --git a/app/src/main/java/eu/kanade/presentation/entries/components/EntryBottomActionMenu.kt b/app/src/main/java/eu/kanade/presentation/entries/components/EntryBottomActionMenu.kt index 5bdf995af..bd12639d3 100644 --- a/app/src/main/java/eu/kanade/presentation/entries/components/EntryBottomActionMenu.kt +++ b/app/src/main/java/eu/kanade/presentation/entries/components/EntryBottomActionMenu.kt @@ -32,7 +32,7 @@ import androidx.compose.material.icons.outlined.Download import androidx.compose.material.icons.outlined.Input import androidx.compose.material.icons.outlined.OpenInNew import androidx.compose.material.icons.outlined.RemoveDone -import androidx.compose.material.ripple.rememberRipple +import androidx.compose.material.ripple import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface @@ -235,7 +235,7 @@ private fun RowScope.Button( .weight(animatedWeight) .combinedClickable( interactionSource = remember { MutableInteractionSource() }, - indication = rememberRipple(bounded = false), + indication = ripple(bounded = false), onLongClick = onLongClick, onClick = onClick, ), diff --git a/app/src/main/java/eu/kanade/presentation/entries/manga/ChapterSettingsDialog.kt b/app/src/main/java/eu/kanade/presentation/entries/manga/ChapterSettingsDialog.kt index 83787e281..d9b93c52e 100644 --- a/app/src/main/java/eu/kanade/presentation/entries/manga/ChapterSettingsDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/entries/manga/ChapterSettingsDialog.kt @@ -31,7 +31,7 @@ import eu.kanade.domain.entries.manga.model.forceDownloaded import eu.kanade.presentation.components.TabbedDialog import eu.kanade.presentation.components.TabbedDialogPaddings import kotlinx.collections.immutable.persistentListOf -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.LabeledCheckbox diff --git a/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreen.kt b/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreen.kt index 2c01590d6..8f1add91b 100644 --- a/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreen.kt @@ -20,7 +20,7 @@ import tachiyomi.presentation.core.components.ListGroupHeader import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.LoadingScreen -import java.util.Date +import java.time.LocalDate @Composable fun AnimeHistoryScreen( @@ -104,7 +104,7 @@ private fun AnimeHistoryScreenContent( } sealed interface AnimeHistoryUiModel { - data class Header(val date: Date) : AnimeHistoryUiModel + data class Header(val date: LocalDate) : AnimeHistoryUiModel data class Item(val item: AnimeHistoryWithRelations) : AnimeHistoryUiModel } diff --git a/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreenModelStateProvider.kt b/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreenModelStateProvider.kt index b0fb050ae..7c9c2a0e3 100644 --- a/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreenModelStateProvider.kt +++ b/app/src/main/java/eu/kanade/presentation/history/anime/AnimeHistoryScreenModelStateProvider.kt @@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.ui.history.anime.AnimeHistoryScreenModel import tachiyomi.domain.entries.anime.model.AnimeCover import tachiyomi.domain.history.anime.model.AnimeHistoryWithRelations import java.time.Instant +import java.time.LocalDate import java.time.temporal.ChronoUnit import java.util.Date import kotlin.random.Random @@ -71,10 +72,10 @@ class AnimeHistoryScreenModelStateProvider : PreviewParameterProvider Instant = { it }) = - AnimeHistoryUiModel.Header(Date.from(instantBuilder(Instant.now()))) + AnimeHistoryUiModel.Header(LocalDate.from(instantBuilder(Instant.now()))) fun items() = sequence { var count = 1 diff --git a/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreen.kt b/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreen.kt index 5021f5624..7734578b9 100644 --- a/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreen.kt @@ -20,7 +20,7 @@ import tachiyomi.presentation.core.components.ListGroupHeader import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.LoadingScreen -import java.util.Date +import java.time.LocalDate @Composable fun MangaHistoryScreen( @@ -104,7 +104,7 @@ private fun MangaHistoryScreenContent( } sealed interface MangaHistoryUiModel { - data class Header(val date: Date) : MangaHistoryUiModel + data class Header(val date: LocalDate) : MangaHistoryUiModel data class Item(val item: MangaHistoryWithRelations) : MangaHistoryUiModel } diff --git a/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreenModelStateProvider.kt b/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreenModelStateProvider.kt index 551ec0c81..6f84b93c3 100644 --- a/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreenModelStateProvider.kt +++ b/app/src/main/java/eu/kanade/presentation/history/manga/MangaHistoryScreenModelStateProvider.kt @@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.ui.history.manga.MangaHistoryScreenModel import tachiyomi.domain.entries.manga.model.MangaCover import tachiyomi.domain.history.manga.model.MangaHistoryWithRelations import java.time.Instant +import java.time.LocalDate import java.time.temporal.ChronoUnit import java.util.Date import kotlin.random.Random @@ -71,10 +72,10 @@ class MangaHistoryScreenModelStateProvider : PreviewParameterProvider Instant = { it }) = - MangaHistoryUiModel.Header(Date.from(instantBuilder(Instant.now()))) + MangaHistoryUiModel.Header(LocalDate.from(instantBuilder(Instant.now()))) fun items() = sequence { var count = 1 diff --git a/app/src/main/java/eu/kanade/presentation/library/DeleteLibraryEntryDialog.kt b/app/src/main/java/eu/kanade/presentation/library/DeleteLibraryEntryDialog.kt index 645dd3efe..f9a78f1cc 100644 --- a/app/src/main/java/eu/kanade/presentation/library/DeleteLibraryEntryDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/library/DeleteLibraryEntryDialog.kt @@ -10,7 +10,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import dev.icerock.moko.resources.StringResource -import tachiyomi.core.preference.CheckboxState +import tachiyomi.core.common.preference.CheckboxState import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/presentation/library/anime/AnimeLibrarySettingsDialog.kt b/app/src/main/java/eu/kanade/presentation/library/anime/AnimeLibrarySettingsDialog.kt index 450053d8a..5059ee4bf 100644 --- a/app/src/main/java/eu/kanade/presentation/library/anime/AnimeLibrarySettingsDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/library/anime/AnimeLibrarySettingsDialog.kt @@ -19,7 +19,7 @@ import eu.kanade.tachiyomi.ui.library.anime.AnimeLibrarySettingsScreenModel import eu.kanade.tachiyomi.util.system.isDevFlavor import eu.kanade.tachiyomi.util.system.isPreviewBuildType import kotlinx.collections.immutable.persistentListOf -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.anime.model.AnimeLibrarySort import tachiyomi.domain.library.anime.model.sort diff --git a/app/src/main/java/eu/kanade/presentation/library/manga/MangaLibrarySettingsDialog.kt b/app/src/main/java/eu/kanade/presentation/library/manga/MangaLibrarySettingsDialog.kt index 2c0fa26fa..9e0a59f43 100644 --- a/app/src/main/java/eu/kanade/presentation/library/manga/MangaLibrarySettingsDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/library/manga/MangaLibrarySettingsDialog.kt @@ -19,7 +19,7 @@ import eu.kanade.tachiyomi.ui.library.manga.MangaLibrarySettingsScreenModel import eu.kanade.tachiyomi.util.system.isDevFlavor import eu.kanade.tachiyomi.util.system.isPreviewBuildType import kotlinx.collections.immutable.persistentListOf -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.manga.model.MangaLibrarySort import tachiyomi.domain.library.manga.model.sort diff --git a/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt b/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt index 43707d45b..feb0067e0 100644 --- a/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt @@ -28,7 +28,7 @@ import eu.kanade.presentation.components.WarningBanner import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.ui.more.DownloadQueueState import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.ScrollbarLazyColumn diff --git a/app/src/main/java/eu/kanade/presentation/more/onboarding/StorageStep.kt b/app/src/main/java/eu/kanade/presentation/more/onboarding/StorageStep.kt index ac515f0f1..fe4efdcc8 100644 --- a/app/src/main/java/eu/kanade/presentation/more/onboarding/StorageStep.kt +++ b/app/src/main/java/eu/kanade/presentation/more/onboarding/StorageStep.kt @@ -21,7 +21,7 @@ import eu.kanade.presentation.more.settings.screen.SettingsDataScreen import eu.kanade.tachiyomi.util.system.isTvBox import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.flow.collectLatest -import tachiyomi.core.storage.AndroidStorageFolderProvider +import tachiyomi.core.common.storage.AndroidStorageFolderProvider import tachiyomi.domain.storage.service.StoragePreferences import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.Button diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/Preference.kt b/app/src/main/java/eu/kanade/presentation/more/settings/Preference.kt index c769799a7..3c038591e 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/Preference.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/Preference.kt @@ -8,7 +8,7 @@ import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableMap import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource -import tachiyomi.core.preference.Preference as PreferenceData +import tachiyomi.core.common.preference.Preference as PreferenceData sealed class Preference { abstract val title: String diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/AdvancedPlayerSettingsScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/AdvancedPlayerSettingsScreen.kt index 93ffff07d..3d0d72d67 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/AdvancedPlayerSettingsScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/AdvancedPlayerSettingsScreen.kt @@ -14,7 +14,7 @@ import eu.kanade.presentation.more.settings.Preference import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences import eu.kanade.tachiyomi.ui.player.viewer.VideoDebanding import kotlinx.collections.immutable.toImmutableMap -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.storage.service.StorageManager import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt index 41f2b5c56..d1dd5e924 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt @@ -68,10 +68,10 @@ import kotlinx.collections.immutable.toPersistentMap import kotlinx.coroutines.launch import logcat.LogPriority import okhttp3.Headers -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.interactor.ResetMangaViewerFlags import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt index 90899dac7..99fc61eb2 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt @@ -23,13 +23,13 @@ import eu.kanade.presentation.more.settings.widget.AppThemePreferenceWidget import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableMap -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.util.collectAsState import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.time.Instant +import java.time.LocalDate object SettingsAppearanceScreen : SearchableSettings { @@ -104,7 +104,7 @@ object SettingsAppearanceScreen : SearchableSettings { val context = LocalContext.current val navigator = LocalNavigator.currentOrThrow - val now = remember { Instant.now().toEpochMilli() } + val now = remember { LocalDate.now() } val dateFormat by uiPreferences.dateFormat().collectAsState() val formattedNow = remember(dateFormat) { diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt index 154455b62..09ba9df6d 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt @@ -14,7 +14,7 @@ import eu.kanade.presentation.more.settings.screen.browse.AnimeExtensionReposScr import eu.kanade.presentation.more.settings.screen.browse.MangaExtensionReposScreen import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate import kotlinx.collections.immutable.persistentListOf -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.pluralStringResource import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt index 7c0c9c7c2..422bd3ae3 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt @@ -52,11 +52,11 @@ import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentMapOf import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.storage.displayablePath -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.displayablePath +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.backup.service.BackupPreferences import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.storage.service.StoragePreferences @@ -102,7 +102,7 @@ object SettingsDataScreen : SearchableSettings { @Composable fun storageLocationPicker( - storageDirPref: tachiyomi.core.preference.Preference, + storageDirPref: tachiyomi.core.common.preference.Preference, ): ManagedActivityResultLauncher { val context = LocalContext.current @@ -124,7 +124,7 @@ object SettingsDataScreen : SearchableSettings { @Composable fun storageLocationText( - storageDirPref: tachiyomi.core.preference.Preference, + storageDirPref: tachiyomi.core.common.preference.Preference, ): String { val context = LocalContext.current val storageDir by storageDirPref.collectAsState() diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt index 88c2083e1..8472fbf88 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt @@ -345,7 +345,10 @@ object SettingsReaderScreen : SearchableSettings { Preference.PreferenceItem.SwitchPreference( pref = readerPreferences.webtoonDoubleTapZoomEnabled(), title = stringResource(MR.strings.pref_double_tap_zoom), - enabled = true, + ), + Preference.PreferenceItem.SwitchPreference( + pref = readerPreferences.webtoonDisableZoomOut(), + title = stringResource(MR.strings.pref_webtoon_disable_zoom_out), ), ), ) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt index f8d1ce23a..4305f0d09 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsSecurityScreen.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.isAuthenticationSupported import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableMap -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.pluralStringResource import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsTrackingScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsTrackingScreen.kt index d1cfb3590..f3f7ed901 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsTrackingScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsTrackingScreen.kt @@ -55,9 +55,9 @@ import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableList -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withUIContext import tachiyomi.domain.source.anime.service.AnimeSourceManager import tachiyomi.domain.source.manga.service.MangaSourceManager import tachiyomi.i18n.MR diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt index e5d477346..a587c631d 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/about/AboutScreen.kt @@ -38,10 +38,10 @@ import eu.kanade.tachiyomi.util.system.copyToClipboard import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.release.interactor.GetApplicationRelease import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.LinkIcon @@ -53,10 +53,10 @@ import tachiyomi.presentation.core.icons.Discord import tachiyomi.presentation.core.icons.Github import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.text.DateFormat -import java.text.SimpleDateFormat +import java.time.LocalDateTime +import java.time.ZoneId +import java.time.format.DateTimeFormatter import java.util.Locale -import java.util.TimeZone object AboutScreen : Screen() { @@ -270,16 +270,9 @@ object AboutScreen : Screen() { internal fun getFormattedBuildTime(): String { return try { - val inputDf = SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'", Locale.US) - inputDf.timeZone = TimeZone.getTimeZone("UTC") - val buildTime = inputDf.parse(BuildConfig.BUILD_TIME) - - val outputDf = DateFormat.getDateTimeInstance( - DateFormat.MEDIUM, - DateFormat.SHORT, - Locale.getDefault(), - ) - outputDf.timeZone = TimeZone.getDefault() + val df = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm'Z'", Locale.US) + .withZone(ZoneId.of("UTC")) + val buildTime = LocalDateTime.from(df.parse(BuildConfig.BUILD_TIME)) buildTime!!.toDateTimestampString( UiPreferences.dateFormat(Injekt.get().dateFormat().get()), diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearAnimeDatabaseScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearAnimeDatabaseScreen.kt index 388343124..06ce7274a 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearAnimeDatabaseScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearAnimeDatabaseScreen.kt @@ -42,10 +42,10 @@ import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.update -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchUI -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchUI +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.domain.source.anime.interactor.GetAnimeSourcesWithNonLibraryAnime import tachiyomi.domain.source.anime.model.AnimeSource import tachiyomi.domain.source.anime.model.AnimeSourceWithCount diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearDatabaseScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearDatabaseScreen.kt index a189cc047..231cc9659 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearDatabaseScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/advanced/ClearDatabaseScreen.kt @@ -37,10 +37,10 @@ import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.update -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchUI -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchUI +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.data.Database import tachiyomi.domain.source.manga.interactor.GetMangaSourcesWithNonLibraryManga import tachiyomi.domain.source.manga.model.MangaSourceWithCount diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt index bdba9e15c..b59b26aca 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt @@ -30,7 +30,7 @@ import eu.kanade.tachiyomi.util.system.LocaleHelper import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import org.xmlpull.v1.XmlPullParser -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/AnimeExtensionReposScreenModel.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/AnimeExtensionReposScreenModel.kt index 5222b84df..b9b9156c2 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/AnimeExtensionReposScreenModel.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/AnimeExtensionReposScreenModel.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/MangaExtensionReposScreenModel.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/MangaExtensionReposScreenModel.kt index a9acd0be7..306523348 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/MangaExtensionReposScreenModel.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/browse/MangaExtensionReposScreenModel.kt @@ -13,7 +13,7 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt index db51a1c82..758be43fa 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt @@ -26,7 +26,7 @@ import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.ImmutableList import kotlinx.coroutines.flow.update -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.components.LazyColumnWithAction diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/debug/WorkerInfoScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/debug/WorkerInfoScreen.kt index e3fd6f15e..e838dd666 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/debug/WorkerInfoScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/debug/WorkerInfoScreen.kt @@ -42,7 +42,9 @@ import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.util.plus import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.util.Date +import java.time.Instant +import java.time.LocalDateTime +import java.time.ZoneId class WorkerInfoScreen : Screen() { @@ -151,13 +153,16 @@ class WorkerInfoScreen : Screen() { } appendLine("State: ${workInfo.state}") if (workInfo.state == WorkInfo.State.ENQUEUED) { - appendLine( - "Next scheduled run: ${Date(workInfo.nextScheduleTimeMillis).toDateTimestampString( + val timestamp = LocalDateTime.ofInstant( + Instant.ofEpochMilli(workInfo.nextScheduleTimeMillis), + ZoneId.systemDefault(), + ) + .toDateTimestampString( UiPreferences.dateFormat( Injekt.get().dateFormat().get(), ), - )}", - ) + ) + appendLine("Next scheduled run: $timestamp") appendLine("Attempt #${workInfo.runAttemptCount + 1}") } appendLine() diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt index 72bb00a18..773a3d4fb 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt @@ -48,7 +48,7 @@ import eu.kanade.presentation.entries.components.ItemCover import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.isDynamicColorAvailable -import tachiyomi.core.preference.InMemoryPreferenceStore +import tachiyomi.core.common.preference.InMemoryPreferenceStore import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/presentation/reader/settings/ColorFilterPage.kt b/app/src/main/java/eu/kanade/presentation/reader/settings/ColorFilterPage.kt index 1c5a9c6fb..cb8f5578b 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/settings/ColorFilterPage.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/settings/ColorFilterPage.kt @@ -11,7 +11,7 @@ import androidx.core.graphics.green import androidx.core.graphics.red import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences.Companion.ColorFilterMode import eu.kanade.tachiyomi.ui.reader.setting.ReaderSettingsScreenModel -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.getAndSet import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.CheckboxItem import tachiyomi.presentation.core.components.SettingsChipRow diff --git a/app/src/main/java/eu/kanade/presentation/reader/settings/GeneralSettingsPage.kt b/app/src/main/java/eu/kanade/presentation/reader/settings/GeneralSettingsPage.kt index 6b631d4ee..2f2832feb 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/settings/GeneralSettingsPage.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/settings/GeneralSettingsPage.kt @@ -42,7 +42,7 @@ internal fun ColumnScope.GeneralPage(screenModel: ReaderSettingsScreenModel) { pref = screenModel.preferences.fullscreen(), ) - if (screenModel.hasDisplayCutout) { + if (screenModel.hasDisplayCutout && screenModel.preferences.fullscreen().get()) { CheckboxItem( label = stringResource(MR.strings.pref_cutout_short), pref = screenModel.preferences.cutoutShort(), diff --git a/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt b/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt index 43b074a12..5a675f08b 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt @@ -205,6 +205,10 @@ private fun ColumnScope.WebtoonViewerSettings(screenModel: ReaderSettingsScreenM label = stringResource(MR.strings.pref_double_tap_zoom), pref = screenModel.preferences.webtoonDoubleTapZoomEnabled(), ) + CheckboxItem( + label = stringResource(MR.strings.pref_webtoon_disable_zoom_out), + pref = screenModel.preferences.webtoonDisableZoomOut(), + ) } @Composable diff --git a/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt b/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt index 75b91978c..5d860b702 100644 --- a/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt +++ b/app/src/main/java/eu/kanade/presentation/theme/TachiyomiTheme.kt @@ -8,6 +8,7 @@ import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.ui.platform.LocalContext import eu.kanade.domain.ui.UiPreferences import eu.kanade.domain.ui.model.AppTheme +import eu.kanade.presentation.theme.colorscheme.BaseColorScheme import eu.kanade.presentation.theme.colorscheme.CloudflareColorScheme import eu.kanade.presentation.theme.colorscheme.CottoncandyColorScheme import eu.kanade.presentation.theme.colorscheme.DoomColorScheme @@ -69,29 +70,33 @@ private fun getThemeColorScheme( isAmoled: Boolean, ): ColorScheme { val uiPreferences = Injekt.get() - val colorScheme = when (appTheme) { - AppTheme.DEFAULT -> TachiyomiColorScheme - AppTheme.MONET -> MonetColorScheme(LocalContext.current) - AppTheme.CLOUDFLARE -> CloudflareColorScheme - AppTheme.COTTONCANDY -> CottoncandyColorScheme - AppTheme.DOOM -> DoomColorScheme - AppTheme.GREEN_APPLE -> GreenAppleColorScheme - AppTheme.LAVENDER -> LavenderColorScheme - AppTheme.MATRIX -> MatrixColorScheme - AppTheme.MIDNIGHT_DUSK -> MidnightDuskColorScheme - AppTheme.MOCHA -> MochaColorScheme - AppTheme.SAPPHIRE -> SapphireColorScheme - AppTheme.NORD -> NordColorScheme - AppTheme.STRAWBERRY_DAIQUIRI -> StrawberryColorScheme - AppTheme.TAKO -> TakoColorScheme - AppTheme.TEALTURQUOISE -> TealTurqoiseColorScheme - AppTheme.TIDAL_WAVE -> TidalWaveColorScheme - AppTheme.YINYANG -> YinYangColorScheme - AppTheme.YOTSUBA -> YotsubaColorScheme - else -> TachiyomiColorScheme + val colorScheme = if (appTheme == AppTheme.MONET) { + MonetColorScheme(LocalContext.current) + } else { + colorSchemes.getOrDefault(appTheme, TachiyomiColorScheme) } return colorScheme.getColorScheme( isSystemInDarkTheme(), isAmoled, ) } + +private val colorSchemes: Map = mapOf( + AppTheme.DEFAULT to TachiyomiColorScheme, + AppTheme.CLOUDFLARE to CloudflareColorScheme, + AppTheme.COTTONCANDY to CottoncandyColorScheme, + AppTheme.DOOM to DoomColorScheme, + AppTheme.GREEN_APPLE to GreenAppleColorScheme, + AppTheme.LAVENDER to LavenderColorScheme, + AppTheme.MATRIX to MatrixColorScheme, + AppTheme.MIDNIGHT_DUSK to MidnightDuskColorScheme, + AppTheme.MOCHA to MochaColorScheme, + AppTheme.SAPPHIRE to SapphireColorScheme, + AppTheme.NORD to NordColorScheme, + AppTheme.STRAWBERRY_DAIQUIRI to StrawberryColorScheme, + AppTheme.TAKO to TakoColorScheme, + AppTheme.TEALTURQUOISE to TealTurqoiseColorScheme, + AppTheme.TIDAL_WAVE to TidalWaveColorScheme, + AppTheme.YINYANG to YinYangColorScheme, + AppTheme.YOTSUBA to YotsubaColorScheme, +) diff --git a/app/src/main/java/eu/kanade/presentation/theme/colorscheme/BaseColorScheme.kt b/app/src/main/java/eu/kanade/presentation/theme/colorscheme/BaseColorScheme.kt index 605d5e5a5..97455fd9e 100644 --- a/app/src/main/java/eu/kanade/presentation/theme/colorscheme/BaseColorScheme.kt +++ b/app/src/main/java/eu/kanade/presentation/theme/colorscheme/BaseColorScheme.kt @@ -9,18 +9,15 @@ internal abstract class BaseColorScheme { abstract val lightScheme: ColorScheme fun getColorScheme(isDark: Boolean, isAmoled: Boolean): ColorScheme { - return (if (isDark) darkScheme else lightScheme) - .let { - if (isDark && isAmoled) { - it.copy( - background = Color.Black, - onBackground = Color.White, - surface = Color.Black, - onSurface = Color.White, - ) - } else { - it - } - } + if (!isDark) return lightScheme + + if (!isAmoled) return darkScheme + + return darkScheme.copy( + background = Color.Black, + onBackground = Color.White, + surface = Color.Black, + onSurface = Color.White, + ) } } diff --git a/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHome.kt b/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHome.kt index 81cf8e15e..e6fa4ac69 100644 --- a/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHome.kt +++ b/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHome.kt @@ -40,17 +40,18 @@ import eu.kanade.presentation.track.manga.TrackDetailsItem import eu.kanade.presentation.track.manga.TrackInfoItemMenu import eu.kanade.tachiyomi.data.track.Tracker import eu.kanade.tachiyomi.ui.entries.anime.track.AnimeTrackItem +import eu.kanade.tachiyomi.util.lang.toLocalDate import eu.kanade.tachiyomi.util.system.copyToClipboard import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource -import java.text.DateFormat +import java.time.format.DateTimeFormatter private const val UnsetStatusTextAlpha = 0.5F @Composable fun AnimeTrackInfoDialogHome( trackItems: List, - dateFormat: DateFormat, + dateFormat: DateTimeFormatter, onStatusClick: (AnimeTrackItem) -> Unit, onEpisodeClick: (AnimeTrackItem) -> Unit, onScoreClick: (AnimeTrackItem) -> Unit, @@ -94,13 +95,13 @@ fun AnimeTrackInfoDialogHome( .takeIf { supportsScoring }, startDate = remember(item.track.startDate) { dateFormat.format( - item.track.startDate, + item.track.startDate.toLocalDate(), ) } .takeIf { supportsReadingDates && item.track.startDate != 0L }, onStartDateClick = { onStartDateEdit(item) } // TODO .takeIf { supportsReadingDates }, - endDate = dateFormat.format(item.track.finishDate) + endDate = dateFormat.format(item.track.finishDate.toLocalDate()) .takeIf { supportsReadingDates && item.track.finishDate != 0L }, onEndDateClick = { onEndDateEdit(item) } .takeIf { supportsReadingDates }, diff --git a/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHomePreviewProvider.kt b/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHomePreviewProvider.kt index f1e586a1f..375829c5f 100644 --- a/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHomePreviewProvider.kt +++ b/app/src/main/java/eu/kanade/presentation/track/anime/AnimeTrackInfoDialogHomePreviewProvider.kt @@ -5,7 +5,8 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import eu.kanade.tachiyomi.ui.entries.anime.track.AnimeTrackItem import eu.kanade.test.DummyTracker import tachiyomi.domain.track.anime.model.AnimeTrack -import java.text.DateFormat +import java.time.format.DateTimeFormatter +import java.time.format.FormatStyle internal class AnimeTrackInfoDialogHomePreviewProvider : PreviewParameterProvider<@Composable () -> Unit> { @@ -46,7 +47,7 @@ internal class AnimeTrackInfoDialogHomePreviewProvider : trackItemWithoutTrack, trackItemWithTrack, ), - dateFormat = DateFormat.getDateInstance(), + dateFormat = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM), onStatusClick = {}, onEpisodeClick = {}, onScoreClick = {}, @@ -61,7 +62,7 @@ internal class AnimeTrackInfoDialogHomePreviewProvider : private val noTrackers = @Composable { AnimeTrackInfoDialogHome( trackItems = listOf(), - dateFormat = DateFormat.getDateInstance(), + dateFormat = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM), onStatusClick = {}, onEpisodeClick = {}, onScoreClick = {}, diff --git a/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHome.kt b/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHome.kt index 1563bce0d..a6545d5fc 100644 --- a/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHome.kt +++ b/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHome.kt @@ -51,17 +51,18 @@ import eu.kanade.presentation.theme.TachiyomiPreviewTheme import eu.kanade.presentation.track.components.TrackLogoIcon import eu.kanade.tachiyomi.data.track.Tracker import eu.kanade.tachiyomi.ui.entries.manga.track.MangaTrackItem +import eu.kanade.tachiyomi.util.lang.toLocalDate import eu.kanade.tachiyomi.util.system.copyToClipboard import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource -import java.text.DateFormat +import java.time.format.DateTimeFormatter private const val UnsetStatusTextAlpha = 0.5F @Composable fun MangaTrackInfoDialogHome( trackItems: List, - dateFormat: DateFormat, + dateFormat: DateTimeFormatter, onStatusClick: (MangaTrackItem) -> Unit, onChapterClick: (MangaTrackItem) -> Unit, onScoreClick: (MangaTrackItem) -> Unit, @@ -105,13 +106,13 @@ fun MangaTrackInfoDialogHome( .takeIf { supportsScoring }, startDate = remember(item.track.startDate) { dateFormat.format( - item.track.startDate, + item.track.startDate.toLocalDate(), ) } .takeIf { supportsReadingDates && item.track.startDate != 0L }, onStartDateClick = { onStartDateEdit(item) } // TODO .takeIf { supportsReadingDates }, - endDate = dateFormat.format(item.track.finishDate) + endDate = dateFormat.format(item.track.finishDate.toLocalDate()) .takeIf { supportsReadingDates && item.track.finishDate != 0L }, onEndDateClick = { onEndDateEdit(item) } .takeIf { supportsReadingDates }, diff --git a/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHomePreviewProvider.kt b/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHomePreviewProvider.kt index f8a2cb772..eebcb9ea5 100644 --- a/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHomePreviewProvider.kt +++ b/app/src/main/java/eu/kanade/presentation/track/manga/MangaTrackInfoDialogHomePreviewProvider.kt @@ -5,7 +5,8 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import eu.kanade.tachiyomi.ui.entries.manga.track.MangaTrackItem import eu.kanade.test.DummyTracker import tachiyomi.domain.track.manga.model.MangaTrack -import java.text.DateFormat +import java.time.format.DateTimeFormatter +import java.time.format.FormatStyle internal class MangaTrackInfoDialogHomePreviewProvider : PreviewParameterProvider<@Composable () -> Unit> { @@ -46,7 +47,7 @@ internal class MangaTrackInfoDialogHomePreviewProvider : trackItemWithoutTrack, trackItemWithTrack, ), - dateFormat = DateFormat.getDateInstance(), + dateFormat = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM), onStatusClick = {}, onChapterClick = {}, onScoreClick = {}, @@ -61,7 +62,7 @@ internal class MangaTrackInfoDialogHomePreviewProvider : private val noTrackers = @Composable { MangaTrackInfoDialogHome( trackItems = listOf(), - dateFormat = DateFormat.getDateInstance(), + dateFormat = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM), onStatusClick = {}, onChapterClick = {}, onScoreClick = {}, diff --git a/app/src/main/java/eu/kanade/presentation/updates/anime/AnimeUpdatesScreen.kt b/app/src/main/java/eu/kanade/presentation/updates/anime/AnimeUpdatesScreen.kt index aff2719d6..91ceed2f3 100644 --- a/app/src/main/java/eu/kanade/presentation/updates/anime/AnimeUpdatesScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/updates/anime/AnimeUpdatesScreen.kt @@ -30,7 +30,7 @@ import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.LoadingScreen import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.util.Date +import java.time.LocalDate import kotlin.time.Duration.Companion.seconds @Composable @@ -153,6 +153,6 @@ private fun AnimeUpdatesBottomBar( } sealed interface AnimeUpdatesUiModel { - data class Header(val date: Date) : AnimeUpdatesUiModel + data class Header(val date: LocalDate) : AnimeUpdatesUiModel data class Item(val item: AnimeUpdatesItem) : AnimeUpdatesUiModel } diff --git a/app/src/main/java/eu/kanade/presentation/updates/manga/MangaUpdatesScreen.kt b/app/src/main/java/eu/kanade/presentation/updates/manga/MangaUpdatesScreen.kt index 78569283a..3f5d5ce03 100644 --- a/app/src/main/java/eu/kanade/presentation/updates/manga/MangaUpdatesScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/updates/manga/MangaUpdatesScreen.kt @@ -27,7 +27,7 @@ import tachiyomi.presentation.core.components.material.PullRefresh import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.LoadingScreen -import java.util.Date +import java.time.LocalDate import kotlin.time.Duration.Companion.seconds @Composable @@ -141,6 +141,6 @@ private fun MangaUpdatesBottomBar( } sealed interface MangaUpdatesUiModel { - data class Header(val date: Date) : MangaUpdatesUiModel + data class Header(val date: LocalDate) : MangaUpdatesUiModel data class Item(val item: MangaUpdatesItem) : MangaUpdatesUiModel } diff --git a/app/src/main/java/eu/kanade/presentation/util/ExceptionFormatter.kt b/app/src/main/java/eu/kanade/presentation/util/ExceptionFormatter.kt index 2822a77f3..6d56c8e74 100644 --- a/app/src/main/java/eu/kanade/presentation/util/ExceptionFormatter.kt +++ b/app/src/main/java/eu/kanade/presentation/util/ExceptionFormatter.kt @@ -4,7 +4,7 @@ import android.content.Context import eu.kanade.tachiyomi.animesource.online.LicensedEntryItemsException import eu.kanade.tachiyomi.network.HttpException import eu.kanade.tachiyomi.util.system.isOnline -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.items.chapter.model.NoChaptersException import tachiyomi.domain.items.episode.model.NoEpisodesException import tachiyomi.domain.source.anime.model.AnimeSourceNotInstalledException diff --git a/app/src/main/java/eu/kanade/presentation/util/TimeUtils.kt b/app/src/main/java/eu/kanade/presentation/util/TimeUtils.kt index c6dfacca6..bae6a4677 100644 --- a/app/src/main/java/eu/kanade/presentation/util/TimeUtils.kt +++ b/app/src/main/java/eu/kanade/presentation/util/TimeUtils.kt @@ -4,7 +4,7 @@ import android.content.Context import android.text.format.DateUtils import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource import java.time.Instant diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index 7ce029266..882ed2d83 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -61,9 +61,9 @@ import org.acra.data.StringFormat import org.acra.ktx.initAcra import org.acra.sender.HttpSender import org.conscrypt.Conscrypt -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.preference.Preference -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR import tachiyomi.presentation.widget.entries.anime.AnimeWidgetManager import tachiyomi.presentation.widget.entries.manga.MangaWidgetManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt b/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt index 322983606..1a6d3db63 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi -import tachiyomi.core.util.system.ImageUtil +import tachiyomi.core.common.util.system.ImageUtil /** * Used by extensions. diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 130bbe78d..a034f993f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -24,13 +24,13 @@ import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.workManager -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.TriState -import tachiyomi.core.preference.getAndSet -import tachiyomi.core.preference.getEnum -import tachiyomi.core.preference.minusAssign -import tachiyomi.core.preference.plusAssign +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.preference.getAndSet +import tachiyomi.core.common.preference.getEnum +import tachiyomi.core.common.preference.minusAssign +import tachiyomi.core.common.preference.plusAssign import tachiyomi.domain.backup.service.BackupPreferences import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.library.service.LibraryPreferences.Companion.ENTRY_NON_COMPLETED diff --git a/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt b/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt index 0b64f296c..600dac444 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt @@ -10,7 +10,7 @@ import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder import kotlinx.serialization.json.Json import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import kotlin.system.exitProcess class GlobalExceptionHandler private constructor( diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupNotifier.kt index 1408385e0..9282f1ba3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupNotifier.kt @@ -12,8 +12,8 @@ import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.system.cancelNotification import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notify -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.storage.displayablePath +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.displayablePath import tachiyomi.i18n.MR import uy.kohesive.injekt.injectLazy import java.io.File diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreateJob.kt index cd607480d..80c11c62f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreateJob.kt @@ -24,7 +24,7 @@ import eu.kanade.tachiyomi.util.system.isRunning import eu.kanade.tachiyomi.util.system.setForegroundSafely import eu.kanade.tachiyomi.util.system.workManager import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.backup.service.BackupPreferences import tachiyomi.domain.storage.service.StorageManager import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreator.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreator.kt index 938ddaeba..a90ecde49 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreator.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/BackupCreator.kt @@ -26,8 +26,8 @@ import logcat.LogPriority import okio.buffer import okio.gzip import okio.sink -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.backup.service.BackupPreferences import tachiyomi.domain.entries.anime.interactor.GetAnimeFavorites import tachiyomi.domain.entries.anime.model.Anime diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/creators/PreferenceBackupCreator.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/creators/PreferenceBackupCreator.kt index 1477e2201..77b5c5798 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/creators/PreferenceBackupCreator.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/create/creators/PreferenceBackupCreator.kt @@ -14,8 +14,8 @@ import eu.kanade.tachiyomi.data.backup.models.StringSetPreferenceValue import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.preferenceKey import eu.kanade.tachiyomi.source.sourcePreferences -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore import tachiyomi.domain.source.anime.service.AnimeSourceManager import tachiyomi.domain.source.manga.service.MangaSourceManager import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestoreJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestoreJob.kt index 08d6fbc19..e0d163cd8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestoreJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestoreJob.kt @@ -18,8 +18,8 @@ import eu.kanade.tachiyomi.util.system.isRunning import eu.kanade.tachiyomi.util.system.workManager import kotlinx.coroutines.CancellationException import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR class BackupRestoreJob(private val context: Context, workerParams: WorkerParameters) : diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestorer.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestorer.kt index d6c0f6c48..165d93b8f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestorer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestorer.kt @@ -20,7 +20,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.ensureActive import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import java.io.File import java.text.SimpleDateFormat diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/restorers/PreferenceRestorer.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/restorers/PreferenceRestorer.kt index 70285f9c4..694a0cce3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/restorers/PreferenceRestorer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/restorers/PreferenceRestorer.kt @@ -13,8 +13,8 @@ import eu.kanade.tachiyomi.data.backup.models.StringSetPreferenceValue import eu.kanade.tachiyomi.data.library.anime.AnimeLibraryUpdateJob import eu.kanade.tachiyomi.data.library.manga.MangaLibraryUpdateJob import eu.kanade.tachiyomi.source.sourcePreferences -import tachiyomi.core.preference.AndroidPreferenceStore -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.AndroidPreferenceStore +import tachiyomi.core.common.preference.PreferenceStore import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt index 43f1d1799..dc173fd7b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/cache/ChapterCache.kt @@ -12,7 +12,7 @@ import logcat.LogPriority import okhttp3.Response import okio.buffer import okio.sink -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.chapter.model.Chapter import java.io.File import java.io.IOException diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/coil/AnimeCoverFetcher.kt b/app/src/main/java/eu/kanade/tachiyomi/data/coil/AnimeCoverFetcher.kt index 14b574ee4..a2d5e7d39 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/coil/AnimeCoverFetcher.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/coil/AnimeCoverFetcher.kt @@ -27,7 +27,7 @@ import okio.Source import okio.buffer import okio.sink import okio.source -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.entries.anime.model.AnimeCover import tachiyomi.domain.source.anime.service.AnimeSourceManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt b/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt index 3090c0d68..dfa3c4c68 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/coil/MangaCoverFetcher.kt @@ -27,7 +27,7 @@ import okio.Source import okio.buffer import okio.sink import okio.source -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.entries.manga.model.MangaCover import tachiyomi.domain.source.manga.service.MangaSourceManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/coil/TachiyomiImageDecoder.kt b/app/src/main/java/eu/kanade/tachiyomi/data/coil/TachiyomiImageDecoder.kt index f66001504..a984fc919 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/coil/TachiyomiImageDecoder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/coil/TachiyomiImageDecoder.kt @@ -9,7 +9,7 @@ import coil.decode.ImageSource import coil.fetch.SourceResult import coil.request.Options import okio.BufferedSource -import tachiyomi.core.util.system.ImageUtil +import tachiyomi.core.common.util.system.ImageUtil import tachiyomi.decoder.ImageDecoder /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadCache.kt index b40686e78..6d413653a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadCache.kt @@ -29,11 +29,11 @@ import kotlinx.coroutines.withTimeoutOrNull import kotlinx.serialization.decodeFromByteArray import kotlinx.serialization.protobuf.ProtoBuf import logcat.LogPriority -import tachiyomi.core.storage.extension -import tachiyomi.core.storage.nameWithoutExtension -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.storage.extension +import tachiyomi.core.common.storage.nameWithoutExtension +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode import tachiyomi.domain.source.anime.service.AnimeSourceManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadManager.kt index 9421b597d..4e01afb9a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadManager.kt @@ -15,9 +15,9 @@ import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.runBlocking import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.interactor.GetAnimeCategories import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.anime.model.Anime diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadNotifier.kt index 4b21ee420..aa8c36834 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadNotifier.kt @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.util.lang.chop import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notificationManager import eu.kanade.tachiyomi.util.system.notify -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import uy.kohesive.injekt.injectLazy import java.util.regex.Pattern diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadProvider.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadProvider.kt index e4f990ef9..52ddf08f3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadProvider.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloadProvider.kt @@ -5,9 +5,9 @@ import com.hippo.unifile.UniFile import eu.kanade.tachiyomi.animesource.AnimeSource import eu.kanade.tachiyomi.util.storage.DiskUtil import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.storage.displayablePath -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.displayablePath +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode import tachiyomi.domain.storage.service.StorageManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloader.kt index 746713550..ecd27627d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/anime/AnimeDownloader.kt @@ -48,10 +48,10 @@ import okhttp3.Response import okio.Throttler import okio.buffer import okio.sink -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.storage.extension -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.extension +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadCache.kt index 54cece8bb..113c8e142 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadCache.kt @@ -40,11 +40,11 @@ import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder import kotlinx.serialization.protobuf.ProtoBuf import logcat.LogPriority -import tachiyomi.core.storage.extension -import tachiyomi.core.storage.nameWithoutExtension -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.storage.extension +import tachiyomi.core.common.storage.nameWithoutExtension +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.domain.source.manga.service.MangaSourceManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadManager.kt index 88b3c6e8e..1922e78f0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadManager.kt @@ -15,10 +15,10 @@ import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.runBlocking import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.storage.extension -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.extension +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.interactor.GetMangaCategories import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadNotifier.kt index 4101c8e30..8810b986c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadNotifier.kt @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.util.lang.chop import eu.kanade.tachiyomi.util.system.cancelNotification import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notify -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import uy.kohesive.injekt.injectLazy import java.util.regex.Pattern diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadProvider.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadProvider.kt index f9480944a..ac562b346 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadProvider.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloadProvider.kt @@ -5,9 +5,9 @@ import com.hippo.unifile.UniFile import eu.kanade.tachiyomi.source.MangaSource import eu.kanade.tachiyomi.util.storage.DiskUtil import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.storage.displayablePath -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.displayablePath +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.domain.storage.service.StorageManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloader.kt index 0f94eda05..aa7765fe2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/manga/MangaDownloader.kt @@ -45,15 +45,15 @@ import nl.adaptivity.xmlutil.serialization.XML import okhttp3.Response import okio.Throttler import okio.buffer -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.extension +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNow +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.ImageUtil +import tachiyomi.core.common.util.system.logcat import tachiyomi.core.metadata.comicinfo.COMIC_INFO_FILE import tachiyomi.core.metadata.comicinfo.ComicInfo -import tachiyomi.core.storage.extension -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNow -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.ImageUtil -import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.manga.interactor.GetMangaCategories import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateJob.kt index 0e2dd1d67..8763f11a3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateJob.kt @@ -38,10 +38,10 @@ import kotlinx.coroutines.ensureActive import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.withPermit import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.preference.getAndSet -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.preference.getAndSet +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.interactor.GetAnimeCategories import tachiyomi.domain.category.model.Category import tachiyomi.domain.download.service.DownloadPreferences diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateNotifier.kt index 910238254..1439d5e67 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeLibraryUpdateNotifier.kt @@ -14,7 +14,7 @@ import coil.request.ImageRequest import coil.transform.CircleCropTransformation import eu.kanade.presentation.util.formatEpisodeNumber import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.core.security.SecurityPreferences import eu.kanade.tachiyomi.data.download.anime.AnimeDownloader import eu.kanade.tachiyomi.data.notification.NotificationHandler @@ -27,8 +27,8 @@ import eu.kanade.tachiyomi.util.system.cancelNotification import eu.kanade.tachiyomi.util.system.getBitmapOrNull import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notify -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchUI +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchUI import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode import tachiyomi.domain.library.anime.LibraryAnime diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeMetadataUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeMetadataUpdateJob.kt index 6d4b9e955..a3d8aa404 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeMetadataUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/anime/AnimeMetadataUpdateJob.kt @@ -26,8 +26,8 @@ import kotlinx.coroutines.ensureActive import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.withPermit import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.interactor.GetLibraryAnime import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.entries.anime.model.toAnimeUpdate diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateJob.kt index ba487a8f8..32b34cc35 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateJob.kt @@ -38,10 +38,10 @@ import kotlinx.coroutines.ensureActive import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.withPermit import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.preference.getAndSet -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.preference.getAndSet +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.interactor.GetMangaCategories import tachiyomi.domain.category.model.Category import tachiyomi.domain.download.service.DownloadPreferences @@ -392,7 +392,7 @@ class MangaLibraryUpdateJob(private val context: Context, workerParams: WorkerPa private fun writeErrorFile(errors: List>): File { try { if (errors.isNotEmpty()) { - val file = context.createFileInCacheDir("tachiyomi_update_errors.txt") + val file = context.createFileInCacheDir("aniyomi_update_errors.txt") file.bufferedWriter().use { out -> out.write( context.stringResource(MR.strings.library_errors_help, ERROR_LOG_HELP_URL) + "\n\n", diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateNotifier.kt index b7955f20d..18ab5eab5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaLibraryUpdateNotifier.kt @@ -14,7 +14,7 @@ import coil.request.ImageRequest import coil.transform.CircleCropTransformation import eu.kanade.presentation.util.formatChapterNumber import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.core.security.SecurityPreferences import eu.kanade.tachiyomi.data.download.manga.MangaDownloader import eu.kanade.tachiyomi.data.notification.NotificationHandler @@ -27,8 +27,8 @@ import eu.kanade.tachiyomi.util.system.cancelNotification import eu.kanade.tachiyomi.util.system.getBitmapOrNull import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notify -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchUI +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchUI import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.domain.library.manga.LibraryManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaMetadataUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaMetadataUpdateJob.kt index ad118e8f5..05ee74a1b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaMetadataUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/manga/MangaMetadataUpdateJob.kt @@ -26,8 +26,8 @@ import kotlinx.coroutines.ensureActive import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.withPermit import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.interactor.GetLibraryManga import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.entries.manga.model.toMangaUpdate diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationHandler.kt b/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationHandler.kt index 7421f11c2..4deed4f8d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationHandler.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/notification/NotificationHandler.kt @@ -5,7 +5,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import androidx.core.net.toUri -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.extension.manga.util.MangaExtensionInstaller import eu.kanade.tachiyomi.ui.main.MainActivity 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 bc825a627..3b631da20 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 @@ -6,7 +6,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import androidx.core.net.toUri -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.data.backup.restore.BackupRestoreJob import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager @@ -22,8 +22,8 @@ import eu.kanade.tachiyomi.util.system.notificationManager import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.runBlocking -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.anime.interactor.GetAnime import tachiyomi.domain.entries.anime.model.Anime diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt b/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt index a04f872c3..6a1a14b00 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/notification/Notifications.kt @@ -7,7 +7,7 @@ import androidx.core.app.NotificationManagerCompat.IMPORTANCE_HIGH import androidx.core.app.NotificationManagerCompat.IMPORTANCE_LOW import eu.kanade.tachiyomi.util.system.buildNotificationChannel import eu.kanade.tachiyomi.util.system.buildNotificationChannelGroup -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt index a9a14e3fb..509dd1c00 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt @@ -15,9 +15,9 @@ import eu.kanade.tachiyomi.util.storage.cacheImageDir import eu.kanade.tachiyomi.util.storage.getUriCompat import logcat.LogPriority import okio.IOException -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.system.ImageUtil -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.system.ImageUtil +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/AnimeTracker.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/AnimeTracker.kt index a5210d422..daf4ae76f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/AnimeTracker.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/AnimeTracker.kt @@ -8,9 +8,9 @@ import eu.kanade.tachiyomi.data.track.model.AnimeTrackSearch import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.ImmutableList import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/MangaTracker.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/MangaTracker.kt index adc0ac89a..9c81d5c55 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/MangaTracker.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/MangaTracker.kt @@ -8,9 +8,9 @@ import eu.kanade.tachiyomi.data.track.model.MangaTrackSearch import eu.kanade.tachiyomi.util.system.toast import kotlinx.collections.immutable.ImmutableList import logcat.LogPriority -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.manga.interactor.InsertMangaTrack import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt index 0eea151aa..78fc87a1b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt @@ -27,7 +27,7 @@ import kotlinx.serialization.json.put import kotlinx.serialization.json.putJsonObject import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import uy.kohesive.injekt.injectLazy import java.time.Instant import java.time.LocalDate diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt index b0ab5dca2..0c80a15a2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiApi.kt @@ -23,7 +23,7 @@ import okhttp3.CacheControl import okhttp3.FormBody import okhttp3.OkHttpClient import okhttp3.Request -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import uy.kohesive.injekt.injectLazy import java.net.URLEncoder import java.nio.charset.StandardCharsets diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/jellyfin/JellyfinApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/jellyfin/JellyfinApi.kt index acc245716..715a37da6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/jellyfin/JellyfinApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/jellyfin/JellyfinApi.kt @@ -11,8 +11,8 @@ import logcat.LogPriority import okhttp3.HttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import java.text.SimpleDateFormat import java.util.Date diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kavita/KavitaApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kavita/KavitaApi.kt index 312c7745d..a0fff69d2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kavita/KavitaApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kavita/KavitaApi.kt @@ -12,8 +12,8 @@ import okhttp3.Dns import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import java.io.IOException import java.net.SocketTimeoutException diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt index 3d14f286c..e4bb52397 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/KitsuApi.kt @@ -27,7 +27,7 @@ import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import uy.kohesive.injekt.injectLazy import java.net.URLEncoder import java.nio.charset.StandardCharsets diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/KomgaApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/KomgaApi.kt index 9fa839726..fa25d3717 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/KomgaApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/KomgaApi.kt @@ -14,8 +14,8 @@ import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy private const val READLIST_API = "/api/v1/readlists" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt index 32d50b871..a98ec12c7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/mangaupdates/MangaUpdatesApi.kt @@ -28,7 +28,7 @@ import logcat.LogPriority import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import tachiyomi.domain.track.manga.model.MangaTrack as DomainTrack diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt index 4488e95f3..47d098292 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt @@ -30,7 +30,7 @@ import okhttp3.Headers import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import uy.kohesive.injekt.injectLazy import java.text.SimpleDateFormat import java.util.Locale diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt index 115b3a17f..737513a3c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListInterceptor.kt @@ -21,9 +21,8 @@ class MyAnimeListInterceptor(private val myanimelist: MyAnimeList) : Interceptor } val originalRequest = chain.request() - // Refresh access token if expired - if (oauth != null && oauth!!.isExpired()) { - setAuth(refreshToken(chain)) + if (oauth?.isExpired() == true) { + refreshToken(chain) } if (oauth == null) { @@ -36,27 +35,7 @@ class MyAnimeListInterceptor(private val myanimelist: MyAnimeList) : Interceptor .header("User-Agent", "Aniyomi v${BuildConfig.VERSION_NAME} (${BuildConfig.APPLICATION_ID})") .build() - val response = chain.proceed(authRequest) - val tokenIsExpired = response.headers["www-authenticate"] - ?.contains("The access token expired") ?: false - - // Retry the request once with a new token in case it was not already refreshed - // by the is expired check before. - if (response.code == 401 && tokenIsExpired) { - response.close() - - val newToken = refreshToken(chain) - setAuth(newToken) - - val newRequest = originalRequest.newBuilder() - .addHeader("Authorization", "Bearer ${newToken.access_token}") - .header("User-Agent", "Aniyomi v${BuildConfig.VERSION_NAME} (${BuildConfig.APPLICATION_ID})") - .build() - - return chain.proceed(newRequest) - } - - return response + return chain.proceed(authRequest) } /** @@ -68,22 +47,37 @@ class MyAnimeListInterceptor(private val myanimelist: MyAnimeList) : Interceptor myanimelist.saveOAuth(oauth) } - private fun refreshToken(chain: Interceptor.Chain): OAuth { + private fun refreshToken(chain: Interceptor.Chain): OAuth = synchronized(this) { + if (tokenExpired) throw MALTokenExpired() + oauth?.takeUnless { it.isExpired() }?.let { return@synchronized it } + + val response = try { + chain.proceed(MyAnimeListApi.refreshTokenRequest(oauth!!)) + } catch (_: Throwable) { + throw MALTokenRefreshFailed() + } + + if (response.code == 401) { + myanimelist.setAuthExpired() + throw MALTokenExpired() + } + return runCatching { - val oauthResponse = chain.proceed(MyAnimeListApi.refreshTokenRequest(oauth!!)) - if (oauthResponse.code == 401) { - myanimelist.setAuthExpired() - } - if (oauthResponse.isSuccessful) { - with(json) { oauthResponse.parseAs() } + if (response.isSuccessful) { + with(json) { response.parseAs() } } else { - oauthResponse.close() + response.close() null } } .getOrNull() - ?: throw MALTokenExpired() + ?.also { + this.oauth = it + myanimelist.saveOAuth(it) + } + ?: throw MALTokenRefreshFailed() } } +class MALTokenRefreshFailed : IOException("MAL: Failed to refresh account token") class MALTokenExpired : IOException("MAL: Login has expired") diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt index c57ab0494..8c29e8070 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt @@ -6,14 +6,16 @@ import kotlinx.serialization.Serializable @Serializable data class OAuth( + val token_type: String, val refresh_token: String, val access_token: String, - val token_type: String, - val created_at: Long = System.currentTimeMillis(), val expires_in: Long, -) - -fun OAuth.isExpired() = System.currentTimeMillis() > created_at + (expires_in * 1000) + val created_at: Long = System.currentTimeMillis(), +) { + // Assumes expired a minute earlier + private val adjustedExpiresIn: Long = (expires_in - 60) * 1000 + fun isExpired() = created_at + adjustedExpiresIn < System.currentTimeMillis() +} fun MangaTrack.toMyAnimeListStatus() = when (status) { MyAnimeList.READING -> "reading" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt index ebaa9a12f..2f8ee44c9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriApi.kt @@ -27,7 +27,7 @@ import kotlinx.serialization.json.putJsonObject import okhttp3.FormBody import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import uy.kohesive.injekt.injectLazy import tachiyomi.domain.track.anime.model.AnimeTrack as DomainAnimeTrack import tachiyomi.domain.track.manga.model.MangaTrack as DomainMangaTrack diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/simkl/SimklApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/simkl/SimklApi.kt index 051bf6b94..028c57d19 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/simkl/SimklApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/simkl/SimklApi.kt @@ -32,7 +32,7 @@ import kotlinx.serialization.json.putJsonArray import kotlinx.serialization.json.putJsonObject import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import uy.kohesive.injekt.injectLazy class SimklApi(private val client: OkHttpClient, interceptor: SimklInterceptor) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/SuwayomiApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/SuwayomiApi.kt index daa05e63d..9e1dabe9e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/SuwayomiApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/SuwayomiApi.kt @@ -15,7 +15,7 @@ import okhttp3.Dns import okhttp3.FormBody import okhttp3.Headers import okhttp3.OkHttpClient -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext 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/data/updater/AppUpdateChecker.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt index 31ba58063..8ad6a4be3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.data.updater import android.content.Context import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.util.system.isInstalledFromFDroid -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.release.interactor.GetApplicationRelease import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateDownloadJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateDownloadJob.kt index e4f79f66f..2cd376a0e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateDownloadJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateDownloadJob.kt @@ -23,9 +23,9 @@ import eu.kanade.tachiyomi.util.system.workManager import logcat.LogPriority import okhttp3.internal.http2.ErrorCode import okhttp3.internal.http2.StreamResetException -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR import uy.kohesive.injekt.injectLazy import java.io.File diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateNotifier.kt index 8285597f7..dfc45d901 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateNotifier.kt @@ -13,7 +13,7 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notify -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.release.model.Release import tachiyomi.i18n.MR diff --git a/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt b/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt index 521ff6155..084ff826f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/di/AppModule.kt @@ -37,8 +37,7 @@ import kotlinx.serialization.protobuf.ProtoBuf import nl.adaptivity.xmlutil.XmlDeclMode import nl.adaptivity.xmlutil.core.XmlVersion import nl.adaptivity.xmlutil.serialization.XML -import tachiyomi.core.storage.AndroidStorageFolderProvider -import tachiyomi.core.storage.UniFileTempFileManager +import tachiyomi.core.common.storage.AndroidStorageFolderProvider import tachiyomi.data.AnimeUpdateStrategyColumnAdapter import tachiyomi.data.Database import tachiyomi.data.DateColumnAdapter @@ -178,8 +177,6 @@ class AppModule(val app: Application) : InjektModule { ProtoBuf } - addSingletonFactory { UniFileTempFileManager(app) } - addSingletonFactory { ChapterCache(app, get()) } addSingletonFactory { MangaCoverCache(app) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/di/PreferenceModule.kt b/app/src/main/java/eu/kanade/tachiyomi/di/PreferenceModule.kt index fe6d2160d..85172316a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/di/PreferenceModule.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/di/PreferenceModule.kt @@ -10,9 +10,9 @@ import eu.kanade.tachiyomi.network.NetworkPreferences import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.util.system.isDevFlavor -import tachiyomi.core.preference.AndroidPreferenceStore -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.storage.AndroidStorageFolderProvider +import tachiyomi.core.common.preference.AndroidPreferenceStore +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.storage.AndroidStorageFolderProvider import tachiyomi.domain.backup.service.BackupPreferences import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.library.service.LibraryPreferences diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/AnimeExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/AnimeExtensionManager.kt index 01fe2823c..e5a555602 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/AnimeExtensionManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/AnimeExtensionManager.kt @@ -19,9 +19,9 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.emptyFlow import logcat.LogPriority -import tachiyomi.core.util.lang.launchNow -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchNow +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.anime.model.StubAnimeSource import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt @@ -358,9 +358,12 @@ class AnimeExtensionManager( override fun onExtensionUntrusted(extension: AnimeExtension.Untrusted) { val installedExtension = _installedAnimeExtensionsFlow.value .find { it.pkgName == extension.pkgName } - ?: return - _installedAnimeExtensionsFlow.value -= installedExtension - _untrustedExtensionsFlow.value += extension + + if (installedExtension != null) { + _installedAnimeExtensionsFlow.value -= installedExtension + } else { + _untrustedExtensionsFlow.value += extension + } } override fun onPackageUninstalled(pkgName: String) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/api/AnimeExtensionApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/api/AnimeExtensionApi.kt index 54a2080b3..eba63e4a4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/api/AnimeExtensionApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/api/AnimeExtensionApi.kt @@ -15,10 +15,10 @@ import eu.kanade.tachiyomi.network.parseAs import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json import logcat.LogPriority -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import java.time.Instant import kotlin.time.Duration.Companion.days diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/PackageInstallerInstallerAnime.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/PackageInstallerInstallerAnime.kt index de03218d7..3301f437c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/PackageInstallerInstallerAnime.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/PackageInstallerInstallerAnime.kt @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.util.lang.use import eu.kanade.tachiyomi.util.system.getParcelableExtraCompat import eu.kanade.tachiyomi.util.system.getUriSize import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat class PackageInstallerInstallerAnime(private val service: Service) : InstallerAnime(service) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/ShizukuInstallerAnime.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/ShizukuInstallerAnime.kt index 2b00e75c3..122b69620 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/ShizukuInstallerAnime.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/installer/ShizukuInstallerAnime.kt @@ -12,7 +12,7 @@ import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import logcat.LogPriority import rikka.shizuku.Shizuku -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR import java.io.BufferedReader import java.io.InputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallReceiver.kt index e20879b48..76a2a9153 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallReceiver.kt @@ -14,8 +14,8 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.async import logcat.LogPriority -import tachiyomi.core.util.lang.launchNow -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchNow +import tachiyomi.core.common.util.system.logcat /** * Broadcast receiver that listens for the system's packages installed, updated or removed, and only diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallService.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallService.kt index 9a5420b43..90107ac1f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstallService.kt @@ -15,8 +15,8 @@ import eu.kanade.tachiyomi.extension.anime.util.AnimeExtensionInstaller.Companio import eu.kanade.tachiyomi.util.system.getSerializableExtraCompat import eu.kanade.tachiyomi.util.system.notificationBuilder import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR class AnimeExtensionInstallService : Service() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstaller.kt index f2aa94372..e44b01bf2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionInstaller.kt @@ -27,8 +27,8 @@ import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onCompletion import kotlinx.coroutines.flow.transformWhile import logcat.LogPriority -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat 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/extension/anime/util/AnimeExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionLoader.kt index ed44072be..17508d589 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/anime/util/AnimeExtensionLoader.kt @@ -7,7 +7,6 @@ import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.os.Build import androidx.core.content.pm.PackageInfoCompat -import dalvik.system.PathClassLoader import eu.kanade.domain.extension.anime.interactor.TrustAnimeExtension import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource @@ -17,11 +16,12 @@ import eu.kanade.tachiyomi.extension.anime.model.AnimeExtension import eu.kanade.tachiyomi.extension.anime.model.AnimeLoadResult import eu.kanade.tachiyomi.util.lang.Hash import eu.kanade.tachiyomi.util.storage.copyAndSetReadOnlyTo +import eu.kanade.tachiyomi.util.system.ChildFirstPathClassLoader import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.runBlocking import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import java.io.File @@ -283,7 +283,7 @@ internal object AnimeExtensionLoader { } val classLoader = try { - PathClassLoader(appInfo.sourceDir, null, context.classLoader) + ChildFirstPathClassLoader(appInfo.sourceDir, null, context.classLoader) } catch (e: Exception) { logcat(LogPriority.ERROR, e) { "Extension load error: $extName ($pkgName)" } return AnimeLoadResult.Error diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/MangaExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/MangaExtensionManager.kt index 433baa1d4..cd854a247 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/MangaExtensionManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/MangaExtensionManager.kt @@ -19,10 +19,10 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.emptyFlow import logcat.LogPriority -import tachiyomi.core.preference.plusAssign -import tachiyomi.core.util.lang.launchNow -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.preference.plusAssign +import tachiyomi.core.common.util.lang.launchNow +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.manga.model.StubMangaSource import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt @@ -348,9 +348,12 @@ class MangaExtensionManager( override fun onExtensionUntrusted(extension: MangaExtension.Untrusted) { val installedExtension = _installedExtensionsFlow.value .find { it.pkgName == extension.pkgName } - ?: return - _installedExtensionsFlow.value -= installedExtension - _untrustedExtensionsFlow.value += extension + + if (installedExtension != null) { + _installedExtensionsFlow.value -= installedExtension + } else { + _untrustedExtensionsFlow.value += extension + } } override fun onPackageUninstalled(pkgName: String) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/api/MangaExtensionApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/api/MangaExtensionApi.kt index 8e888a1d9..524caceef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/api/MangaExtensionApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/api/MangaExtensionApi.kt @@ -14,10 +14,10 @@ import eu.kanade.tachiyomi.network.parseAs import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json import logcat.LogPriority -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import java.time.Instant import kotlin.time.Duration.Companion.days diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/PackageInstallerInstallerManga.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/PackageInstallerInstallerManga.kt index 7f5f042ab..23957b4ef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/PackageInstallerInstallerManga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/PackageInstallerInstallerManga.kt @@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.util.lang.use import eu.kanade.tachiyomi.util.system.getParcelableExtraCompat import eu.kanade.tachiyomi.util.system.getUriSize import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat class PackageInstallerInstallerManga(private val service: Service) : InstallerManga(service) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/ShizukuInstallerManga.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/ShizukuInstallerManga.kt index ba10db6ca..818f8181a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/ShizukuInstallerManga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/installer/ShizukuInstallerManga.kt @@ -12,7 +12,7 @@ import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import logcat.LogPriority import rikka.shizuku.Shizuku -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR import java.io.BufferedReader import java.io.InputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallReceiver.kt index 4ed959117..2a94580bd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallReceiver.kt @@ -14,8 +14,8 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.async import logcat.LogPriority -import tachiyomi.core.util.lang.launchNow -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchNow +import tachiyomi.core.common.util.system.logcat /** * Broadcast receiver that listens for the system's packages installed, updated or removed, and only diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallService.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallService.kt index 72a4f554a..a4b6a3b1f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstallService.kt @@ -15,8 +15,8 @@ import eu.kanade.tachiyomi.extension.manga.util.MangaExtensionInstaller.Companio import eu.kanade.tachiyomi.util.system.getSerializableExtraCompat import eu.kanade.tachiyomi.util.system.notificationBuilder import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR class MangaExtensionInstallService : Service() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstaller.kt index cb1a5a20e..7cf81b79e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionInstaller.kt @@ -27,8 +27,8 @@ import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onCompletion import kotlinx.coroutines.flow.transformWhile import logcat.LogPriority -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat 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/extension/manga/util/MangaExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionLoader.kt index 983e45791..565847211 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/manga/util/MangaExtensionLoader.kt @@ -7,7 +7,6 @@ import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.os.Build import androidx.core.content.pm.PackageInfoCompat -import dalvik.system.PathClassLoader import eu.kanade.domain.extension.manga.interactor.TrustMangaExtension import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.tachiyomi.extension.manga.model.MangaExtension @@ -17,11 +16,12 @@ import eu.kanade.tachiyomi.source.MangaSource import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.util.lang.Hash import eu.kanade.tachiyomi.util.storage.copyAndSetReadOnlyTo +import eu.kanade.tachiyomi.util.system.ChildFirstPathClassLoader import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.runBlocking import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import java.io.File @@ -293,7 +293,7 @@ internal object MangaExtensionLoader { } val classLoader = try { - PathClassLoader(appInfo.sourceDir, null, context.classLoader) + ChildFirstPathClassLoader(appInfo.sourceDir, null, context.classLoader) } catch (e: Exception) { logcat(LogPriority.ERROR, e) { "Extension load error: $extName ($pkgName)" } return MangaLoadResult.Error diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/SecureActivityDelegate.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/SecureActivityDelegate.kt index 02589cec9..c3b94d639 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/SecureActivityDelegate.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/SecureActivityDelegate.kt @@ -1,6 +1,8 @@ package eu.kanade.tachiyomi.ui.base.delegate +import android.app.Activity import android.content.Intent +import android.os.Build import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner @@ -106,7 +108,12 @@ class SecureActivityDelegateImpl : SecureActivityDelegate, DefaultLifecycleObser if (activity.isAuthenticationSupported()) { if (!SecureActivityDelegate.requireUnlock) return activity.startActivity(Intent(activity, UnlockActivity::class.java)) - activity.overridePendingTransition(0, 0) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + activity.overrideActivityTransition(Activity.OVERRIDE_TRANSITION_OPEN, 0, 0) + } else { + @Suppress("DEPRECATION") + activity.overridePendingTransition(0, 0) + } } else { securityPreferences.useAuthenticator().set(false) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/ThemingDelegate.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/ThemingDelegate.kt index c6fe9222b..93b69adb3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/ThemingDelegate.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/ThemingDelegate.kt @@ -12,69 +12,10 @@ interface ThemingDelegate { companion object { fun getThemeResIds(appTheme: AppTheme, isAmoled: Boolean): List { - val resIds = mutableListOf() - when (appTheme) { - AppTheme.MONET -> { - resIds += R.style.Theme_Tachiyomi_Monet - } - AppTheme.COTTONCANDY -> { - resIds += R.style.Theme_Tachiyomi_CottonCandy - } - AppTheme.GREEN_APPLE -> { - resIds += R.style.Theme_Tachiyomi_GreenApple - } - AppTheme.LAVENDER -> { - resIds += R.style.Theme_Tachiyomi_Lavender - } - AppTheme.MIDNIGHT_DUSK -> { - resIds += R.style.Theme_Tachiyomi_MidnightDusk - } - AppTheme.MOCHA -> { - resIds += R.style.Theme_Tachiyomi_Mocha - } - AppTheme.NORD -> { - resIds += R.style.Theme_Tachiyomi_Nord - } - AppTheme.STRAWBERRY_DAIQUIRI -> { - resIds += R.style.Theme_Tachiyomi_StrawberryDaiquiri - } - AppTheme.TAKO -> { - resIds += R.style.Theme_Tachiyomi_Tako - } - AppTheme.TEALTURQUOISE -> { - resIds += R.style.Theme_Tachiyomi_TealTurquoise - } - AppTheme.YINYANG -> { - resIds += R.style.Theme_Tachiyomi_YinYang - } - AppTheme.YOTSUBA -> { - resIds += R.style.Theme_Tachiyomi_Yotsuba - } - AppTheme.CLOUDFLARE -> { - resIds += R.style.Theme_Tachiyomi_Cloudflare - } - AppTheme.SAPPHIRE -> { - resIds += R.style.Theme_Tachiyomi_Sapphire - } - AppTheme.DOOM -> { - resIds += R.style.Theme_Tachiyomi_Doom - } - AppTheme.MATRIX -> { - resIds += R.style.Theme_Tachiyomi_Matrix - } - AppTheme.TIDAL_WAVE -> { - resIds += R.style.Theme_Tachiyomi_TidalWave - } - else -> { - resIds += R.style.Theme_Tachiyomi - } + return buildList(2) { + add(themeResources.getOrDefault(appTheme, R.style.Theme_Tachiyomi)) + if (isAmoled) add(R.style.ThemeOverlay_Tachiyomi_Amoled) } - - if (isAmoled) { - resIds += R.style.ThemeOverlay_Tachiyomi_Amoled - } - - return resIds } } } @@ -89,3 +30,23 @@ class ThemingDelegateImpl : ThemingDelegate { .forEach(activity::setTheme) } } + +private val themeResources: Map = mapOf( + AppTheme.MONET to R.style.Theme_Tachiyomi_Monet, + AppTheme.COTTONCANDY to R.style.Theme_Tachiyomi_CottonCandy, + AppTheme.GREEN_APPLE to R.style.Theme_Tachiyomi_GreenApple, + AppTheme.LAVENDER to R.style.Theme_Tachiyomi_Lavender, + AppTheme.MIDNIGHT_DUSK to R.style.Theme_Tachiyomi_MidnightDusk, + AppTheme.MOCHA to R.style.Theme_Tachiyomi_Mocha, + AppTheme.NORD to R.style.Theme_Tachiyomi_Nord, + AppTheme.STRAWBERRY_DAIQUIRI to R.style.Theme_Tachiyomi_StrawberryDaiquiri, + AppTheme.TAKO to R.style.Theme_Tachiyomi_Tako, + AppTheme.TEALTURQUOISE to R.style.Theme_Tachiyomi_TealTurquoise, + AppTheme.YINYANG to R.style.Theme_Tachiyomi_YinYang, + AppTheme.YOTSUBA to R.style.Theme_Tachiyomi_Yotsuba, + AppTheme.CLOUDFLARE to R.style.Theme_Tachiyomi_Cloudflare, + AppTheme.SAPPHIRE to R.style.Theme_Tachiyomi_Sapphire, + AppTheme.DOOM to R.style.Theme_Tachiyomi_Doom, + AppTheme.MATRIX to R.style.Theme_Tachiyomi_Matrix, + AppTheme.TIDAL_WAVE to R.style.Theme_Tachiyomi_TidalWave, +) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionFilterScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionFilterScreenModel.kt index ee83b4179..8741bf15c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionFilterScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionFilterScreenModel.kt @@ -20,7 +20,7 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionsScreenModel.kt index 2e388a04e..6a3104b32 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/AnimeExtensionsScreenModel.kt @@ -27,7 +27,7 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onCompletion import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/details/AnimeExtensionDetailsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/details/AnimeExtensionDetailsScreenModel.kt index 09310af82..9fb94fbb7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/details/AnimeExtensionDetailsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/extension/details/AnimeExtensionDetailsScreenModel.kt @@ -25,7 +25,7 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority import okhttp3.HttpUrl.Companion.toHttpUrl -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/anime/MigrateAnimeScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/anime/MigrateAnimeScreenModel.kt index 3c7eaaae1..88e21f024 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/anime/MigrateAnimeScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/anime/MigrateAnimeScreenModel.kt @@ -16,7 +16,7 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.interactor.GetAnimeFavorites import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.source.anime.service.AnimeSourceManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/AnimeSourceSearchScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/AnimeSourceSearchScreen.kt index 6104720d3..3034421d4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/AnimeSourceSearchScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/AnimeSourceSearchScreen.kt @@ -22,7 +22,7 @@ import eu.kanade.presentation.browse.anime.BrowseAnimeSourceContent import eu.kanade.presentation.components.SearchToolbar import eu.kanade.presentation.util.Screen import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.ui.browse.anime.source.browse.BrowseAnimeSourceScreenModel import eu.kanade.tachiyomi.ui.browse.anime.source.browse.SourceFilterAnimeDialog import eu.kanade.tachiyomi.ui.entries.anime.AnimeScreen diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/MigrateAnimeDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/MigrateAnimeDialog.kt index d684306d2..865f1cc3d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/MigrateAnimeDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/search/MigrateAnimeDialog.kt @@ -32,10 +32,10 @@ import eu.kanade.tachiyomi.data.track.EnhancedAnimeTracker import eu.kanade.tachiyomi.data.track.TrackerManager import eu.kanade.tachiyomi.ui.browse.anime.migration.AnimeMigrationFlags import kotlinx.coroutines.flow.update -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withUIContext import tachiyomi.domain.category.anime.interactor.GetAnimeCategories import tachiyomi.domain.category.anime.interactor.SetAnimeCategories import tachiyomi.domain.entries.anime.model.Anime diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/sources/MigrateAnimeSourceScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/sources/MigrateAnimeSourceScreenModel.kt index 5bcafe0e8..991f93a57 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/sources/MigrateAnimeSourceScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/migration/sources/MigrateAnimeSourceScreenModel.kt @@ -17,8 +17,8 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.anime.model.AnimeSource import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/AnimeSourcesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/AnimeSourcesScreenModel.kt index da6c995a8..317a55e6a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/AnimeSourcesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/AnimeSourcesScreenModel.kt @@ -20,8 +20,8 @@ import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.anime.model.AnimeSource import tachiyomi.domain.source.anime.model.Pin import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreen.kt index 8ba2fb768..f6ebb7f8d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreen.kt @@ -45,7 +45,7 @@ import eu.kanade.presentation.util.AssistContentScreen import eu.kanade.presentation.util.Screen import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.ui.browse.anime.extension.details.AnimeSourcePreferencesScreen import eu.kanade.tachiyomi.ui.browse.anime.source.browse.BrowseAnimeSourceScreenModel.Listing import eu.kanade.tachiyomi.ui.category.CategoriesTab @@ -54,7 +54,7 @@ import eu.kanade.tachiyomi.ui.webview.WebViewScreen import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.source.anime.model.StubAnimeSource import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.Scaffold diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreenModel.kt index bb341f4fd..bc6f18f45 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/BrowseAnimeSourceScreenModel.kt @@ -35,9 +35,9 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -import tachiyomi.core.preference.CheckboxState -import tachiyomi.core.preference.mapAsCheckboxState -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.preference.CheckboxState +import tachiyomi.core.common.preference.mapAsCheckboxState +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.category.anime.interactor.GetAnimeCategories import tachiyomi.domain.category.anime.interactor.SetAnimeCategories import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/SourceFilterAnimeDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/SourceFilterAnimeDialog.kt index 0a9c46a6a..a096e512e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/SourceFilterAnimeDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/anime/source/browse/SourceFilterAnimeDialog.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.unit.dp import eu.kanade.presentation.components.AdaptiveSheet import eu.kanade.tachiyomi.animesource.model.AnimeFilter import eu.kanade.tachiyomi.animesource.model.AnimeFilterList -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.CheckboxItem import tachiyomi.presentation.core.components.CollapsibleBox diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionFilterScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionFilterScreenModel.kt index f06a46a92..6cfd5d6b8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionFilterScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionFilterScreenModel.kt @@ -20,7 +20,7 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionsScreenModel.kt index 7ce77d80a..0a25d030c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/MangaExtensionsScreenModel.kt @@ -27,7 +27,7 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onCompletion import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/details/MangaExtensionDetailsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/details/MangaExtensionDetailsScreenModel.kt index 9076a7bf4..ddb582b7b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/details/MangaExtensionDetailsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/extension/details/MangaExtensionDetailsScreenModel.kt @@ -25,7 +25,7 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority import okhttp3.HttpUrl.Companion.toHttpUrl -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/manga/MigrateMangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/manga/MigrateMangaScreenModel.kt index 30c78bd16..16dfe825a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/manga/MigrateMangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/manga/MigrateMangaScreenModel.kt @@ -16,7 +16,7 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.interactor.GetMangaFavorites import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.source.manga.service.MangaSourceManager diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MangaSourceSearchScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MangaSourceSearchScreen.kt index 241a4108b..8fdd5253f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MangaSourceSearchScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MangaSourceSearchScreen.kt @@ -21,7 +21,7 @@ import cafe.adriel.voyager.navigator.currentOrThrow import eu.kanade.presentation.browse.manga.BrowseSourceContent import eu.kanade.presentation.components.SearchToolbar import eu.kanade.presentation.util.Screen -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.browse.manga.source.browse.BrowseMangaSourceScreenModel import eu.kanade.tachiyomi.ui.browse.manga.source.browse.SourceFilterMangaDialog diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MigrateMangaDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MigrateMangaDialog.kt index 8a75c29f4..7a14d2dbd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MigrateMangaDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/search/MigrateMangaDialog.kt @@ -32,10 +32,10 @@ import eu.kanade.tachiyomi.source.MangaSource import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.ui.browse.manga.migration.MangaMigrationFlags import kotlinx.coroutines.flow.update -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withUIContext import tachiyomi.domain.category.manga.interactor.GetMangaCategories import tachiyomi.domain.category.manga.interactor.SetMangaCategories import tachiyomi.domain.entries.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/sources/MigrateMangaSourceScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/sources/MigrateMangaSourceScreenModel.kt index 65b6c1e80..1ffa640d5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/sources/MigrateMangaSourceScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/migration/sources/MigrateMangaSourceScreenModel.kt @@ -17,8 +17,8 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.manga.model.Source import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/MangaSourcesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/MangaSourcesScreenModel.kt index c5ebd2b46..40c444f68 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/MangaSourcesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/MangaSourcesScreenModel.kt @@ -24,8 +24,8 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.manga.model.Pin import tachiyomi.domain.source.manga.model.Source import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreen.kt index e84674898..94c7f5f7f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreen.kt @@ -43,7 +43,7 @@ import eu.kanade.presentation.category.components.ChangeCategoryDialog import eu.kanade.presentation.entries.manga.DuplicateMangaDialog import eu.kanade.presentation.util.AssistContentScreen import eu.kanade.presentation.util.Screen -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.browse.manga.extension.details.MangaSourcePreferencesScreen @@ -54,7 +54,7 @@ import eu.kanade.tachiyomi.ui.webview.WebViewScreen import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.source.manga.model.StubMangaSource import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.Scaffold diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreenModel.kt index ff94312ec..c0061e47e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/BrowseMangaSourceScreenModel.kt @@ -35,9 +35,9 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -import tachiyomi.core.preference.CheckboxState -import tachiyomi.core.preference.mapAsCheckboxState -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.preference.CheckboxState +import tachiyomi.core.common.preference.mapAsCheckboxState +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.category.manga.interactor.GetMangaCategories import tachiyomi.domain.category.manga.interactor.SetMangaCategories import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/SourceFilterMangaDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/SourceFilterMangaDialog.kt index 2e4e0d0e1..6cf6848da 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/SourceFilterMangaDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/manga/source/browse/SourceFilterMangaDialog.kt @@ -18,7 +18,7 @@ import androidx.compose.ui.unit.dp import eu.kanade.presentation.components.AdaptiveSheet import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.CheckboxItem import tachiyomi.presentation.core.components.CollapsibleBox diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/anime/DeepLinkAnimeScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/anime/DeepLinkAnimeScreenModel.kt index 4ba8c4de0..15e86b272 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/anime/DeepLinkAnimeScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/anime/DeepLinkAnimeScreenModel.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode import eu.kanade.tachiyomi.animesource.online.ResolvableAnimeSource import eu.kanade.tachiyomi.animesource.online.UriType import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.entries.anime.interactor.GetAnimeByUrlAndSourceId import tachiyomi.domain.entries.anime.interactor.NetworkToLocalAnime import tachiyomi.domain.entries.anime.model.Anime diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/manga/DeepLinkMangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/manga/DeepLinkMangaScreenModel.kt index 5d7c2b167..f6b63f52d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/manga/DeepLinkMangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/deeplink/manga/DeepLinkMangaScreenModel.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.ResolvableSource import eu.kanade.tachiyomi.source.online.UriType import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.entries.manga.interactor.GetMangaByUrlAndSourceId import tachiyomi.domain.entries.manga.interactor.NetworkToLocalManga import tachiyomi.domain.entries.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadHolder.kt index c43461ded..e9ac032a6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadHolder.kt @@ -7,7 +7,7 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload import eu.kanade.tachiyomi.databinding.DownloadItemBinding import eu.kanade.tachiyomi.util.view.popupMenu -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadQueueScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadQueueScreen.kt index 5851ba0ba..8a293cb62 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadQueueScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/anime/AnimeDownloadQueueScreen.kt @@ -19,7 +19,7 @@ import androidx.core.view.updatePadding import androidx.recyclerview.widget.LinearLayoutManager import eu.kanade.tachiyomi.databinding.DownloadListBinding import kotlinx.coroutines.CoroutineScope -import tachiyomi.core.util.lang.launchUI +import tachiyomi.core.common.util.lang.launchUI import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.screens.EmptyScreen diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/manga/MangaDownloadQueueScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/manga/MangaDownloadQueueScreen.kt index bb46050e0..9e911846f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/manga/MangaDownloadQueueScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/manga/MangaDownloadQueueScreen.kt @@ -19,7 +19,7 @@ import androidx.core.view.updatePadding import androidx.recyclerview.widget.LinearLayoutManager import eu.kanade.tachiyomi.databinding.DownloadListBinding import kotlinx.coroutines.CoroutineScope -import tachiyomi.core.util.lang.launchUI +import tachiyomi.core.common.util.lang.launchUI import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.screens.EmptyScreen diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeCoverScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeCoverScreenModel.kt index cd852f4af..cd707d128 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeCoverScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeCoverScreenModel.kt @@ -19,11 +19,11 @@ import eu.kanade.tachiyomi.util.system.toShareIntent import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -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.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.interactor.GetAnime import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.i18n.MR diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreen.kt index 28cf500fa..f2067a38f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreen.kt @@ -55,10 +55,10 @@ import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode import tachiyomi.i18n.MR diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreenModel.kt index 3643e48f4..b217c438f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/AnimeScreenModel.kt @@ -49,15 +49,15 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.preference.CheckboxState -import tachiyomi.core.preference.TriState -import tachiyomi.core.preference.mapAsCheckboxState -import tachiyomi.core.util.lang.launchIO -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.core.common.i18n.stringResource +import tachiyomi.core.common.preference.CheckboxState +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.preference.mapAsCheckboxState +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.interactor.GetAnimeCategories import tachiyomi.domain.category.anime.interactor.SetAnimeCategories import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt index c19206f90..3fe5a7523 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt @@ -65,11 +65,11 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -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.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.interactor.GetAnime import tachiyomi.domain.source.anime.service.AnimeSourceManager import tachiyomi.domain.track.anime.interactor.DeleteAnimeTrack diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaCoverScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaCoverScreenModel.kt index 6c1b82a53..3233e812e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaCoverScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaCoverScreenModel.kt @@ -19,11 +19,11 @@ import eu.kanade.tachiyomi.util.system.toShareIntent import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -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.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.interactor.GetManga import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.i18n.MR diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreen.kt index 3b4e6ced9..09e492504 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreen.kt @@ -55,9 +55,9 @@ import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.i18n.MR diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreenModel.kt index 842333302..e82b25acf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/MangaScreenModel.kt @@ -52,15 +52,15 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.preference.CheckboxState -import tachiyomi.core.preference.TriState -import tachiyomi.core.preference.mapAsCheckboxState -import tachiyomi.core.util.lang.launchIO -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.core.common.i18n.stringResource +import tachiyomi.core.common.preference.CheckboxState +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.preference.mapAsCheckboxState +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.interactor.GetMangaCategories import tachiyomi.domain.category.manga.interactor.SetMangaCategories import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt index 43dfeccc9..3e7287d4f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt @@ -65,11 +65,11 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -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.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.interactor.GetManga import tachiyomi.domain.source.manga.service.MangaSourceManager import tachiyomi.domain.track.manga.interactor.DeleteMangaTrack diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryScreenModel.kt index 685c1b5e4..03b020ec6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryScreenModel.kt @@ -5,7 +5,7 @@ import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.screenModelScope import eu.kanade.core.util.insertSeparators import eu.kanade.presentation.history.anime.AnimeHistoryUiModel -import eu.kanade.tachiyomi.util.lang.toDateKey +import eu.kanade.tachiyomi.util.lang.toLocalDate import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow @@ -21,9 +21,9 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.history.anime.interactor.GetAnimeHistory import tachiyomi.domain.history.anime.interactor.GetNextEpisodes import tachiyomi.domain.history.anime.interactor.RemoveAnimeHistory @@ -31,7 +31,6 @@ import tachiyomi.domain.history.anime.model.AnimeHistoryWithRelations import tachiyomi.domain.items.episode.model.Episode import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.util.Date class AnimeHistoryScreenModel( private val getHistory: GetAnimeHistory = Injekt.get(), @@ -70,10 +69,10 @@ class AnimeHistoryScreenModel( private fun List.toAnimeHistoryUiModels(): List { return map { AnimeHistoryUiModel.Item(it) } .insertSeparators { before, after -> - val beforeDate = before?.item?.seenAt?.time?.toDateKey() ?: Date(0) - val afterDate = after?.item?.seenAt?.time?.toDateKey() ?: Date(0) + val beforeDate = before?.item?.seenAt?.time?.toLocalDate() + val afterDate = after?.item?.seenAt?.time?.toLocalDate() when { - beforeDate.time != afterDate.time && afterDate.time != 0L -> AnimeHistoryUiModel.Header(afterDate) + beforeDate != afterDate && afterDate != null -> AnimeHistoryUiModel.Header(afterDate) // Return null to avoid adding a separator between two items. else -> null } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryTab.kt index 15cb9bf4e..f88c4db40 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/history/anime/AnimeHistoryTab.kt @@ -27,7 +27,7 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.items.episode.model.Episode import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryScreenModel.kt index e1c1fd473..2dcbdddbf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryScreenModel.kt @@ -5,7 +5,7 @@ import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.screenModelScope import eu.kanade.core.util.insertSeparators import eu.kanade.presentation.history.manga.MangaHistoryUiModel -import eu.kanade.tachiyomi.util.lang.toDateKey +import eu.kanade.tachiyomi.util.lang.toLocalDate import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow @@ -21,9 +21,9 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.history.manga.interactor.GetMangaHistory import tachiyomi.domain.history.manga.interactor.GetNextChapters import tachiyomi.domain.history.manga.interactor.RemoveMangaHistory @@ -31,7 +31,6 @@ import tachiyomi.domain.history.manga.model.MangaHistoryWithRelations import tachiyomi.domain.items.chapter.model.Chapter import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get -import java.util.Date class MangaHistoryScreenModel( private val getHistory: GetMangaHistory = Injekt.get(), @@ -70,10 +69,10 @@ class MangaHistoryScreenModel( private fun List.toHistoryUiModels(): List { return map { MangaHistoryUiModel.Item(it) } .insertSeparators { before, after -> - val beforeDate = before?.item?.readAt?.time?.toDateKey() ?: Date(0) - val afterDate = after?.item?.readAt?.time?.toDateKey() ?: Date(0) + val beforeDate = before?.item?.readAt?.time?.toLocalDate() + val afterDate = after?.item?.readAt?.time?.toLocalDate() when { - beforeDate.time != afterDate.time && afterDate.time != 0L -> MangaHistoryUiModel.Header(afterDate) + beforeDate != afterDate && afterDate != null -> MangaHistoryUiModel.Header(afterDate) // Return null to avoid adding a separator between two items. else -> null } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryTab.kt index c3e3aaeea..5260e93e2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/history/manga/MangaHistoryTab.kt @@ -27,7 +27,7 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryScreenModel.kt index e6013eed8..7f7bf7948 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryScreenModel.kt @@ -44,12 +44,12 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update -import tachiyomi.core.preference.CheckboxState -import tachiyomi.core.preference.TriState -import tachiyomi.core.util.lang.compareToWithCollator -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.preference.CheckboxState +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.util.lang.compareToWithCollator +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.category.anime.interactor.GetVisibleAnimeCategories import tachiyomi.domain.category.anime.interactor.SetAnimeCategories import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibrarySettingsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibrarySettingsScreenModel.kt index 7407284f2..f7214745e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibrarySettingsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibrarySettingsScreenModel.kt @@ -4,10 +4,10 @@ import cafe.adriel.voyager.core.model.ScreenModel import cafe.adriel.voyager.core.model.screenModelScope import eu.kanade.domain.base.BasePreferences import eu.kanade.tachiyomi.data.track.TrackerManager -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.TriState -import tachiyomi.core.preference.getAndSet -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.preference.getAndSet +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.category.anime.interactor.SetAnimeDisplayMode import tachiyomi.domain.category.anime.interactor.SetSortModeForAnimeCategory import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryTab.kt index c16de19df..b157171e9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/anime/AnimeLibraryTab.kt @@ -50,8 +50,8 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.category.model.Category import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryScreenModel.kt index 218189c76..a34cfc381 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryScreenModel.kt @@ -44,12 +44,12 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update -import tachiyomi.core.preference.CheckboxState -import tachiyomi.core.preference.TriState -import tachiyomi.core.util.lang.compareToWithCollator -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.preference.CheckboxState +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.util.lang.compareToWithCollator +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.category.manga.interactor.GetVisibleMangaCategories import tachiyomi.domain.category.manga.interactor.SetMangaCategories import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibrarySettingsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibrarySettingsScreenModel.kt index 09301b02f..3f59c7c33 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibrarySettingsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibrarySettingsScreenModel.kt @@ -4,10 +4,10 @@ import cafe.adriel.voyager.core.model.ScreenModel import cafe.adriel.voyager.core.model.screenModelScope import eu.kanade.domain.base.BasePreferences import eu.kanade.tachiyomi.data.track.TrackerManager -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.TriState -import tachiyomi.core.preference.getAndSet -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.preference.getAndSet +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.category.manga.interactor.SetMangaDisplayMode import tachiyomi.domain.category.manga.interactor.SetSortModeForMangaCategory import tachiyomi.domain.category.model.Category diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryTab.kt index 676c1b2df..37c55b877 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/manga/MangaLibraryTab.kt @@ -51,8 +51,8 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.category.model.Category import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.library.manga.LibraryManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index e6529948e..869b6c06e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -69,7 +69,7 @@ import eu.kanade.presentation.util.DefaultNavigatorScreenTransition import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.Migrations import eu.kanade.tachiyomi.animesource.model.Video -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.data.cache.ChapterCache import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadCache import eu.kanade.tachiyomi.data.download.manga.MangaDownloadCache @@ -107,10 +107,10 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.release.interactor.GetApplicationRelease import tachiyomi.i18n.MR diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt index be930f50d..369528c36 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt @@ -34,7 +34,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/ExternalIntents.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/ExternalIntents.kt index 426441e76..db3c68185 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/ExternalIntents.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/ExternalIntents.kt @@ -30,10 +30,10 @@ import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import logcat.LogPriority -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.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.anime.interactor.GetAnime import tachiyomi.domain.entries.anime.model.Anime diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt index e2cfc4846..edc3fd272 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerActivity.kt @@ -94,13 +94,13 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.lang.launchUI -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.launchUI +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.storage.service.StorageManager import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerObserver.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerObserver.kt index 47b6b4840..7c8dfcd72 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerObserver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerObserver.kt @@ -5,10 +5,10 @@ import androidx.lifecycle.viewModelScope import eu.kanade.tachiyomi.util.system.toast import `is`.xyz.mpv.MPVLib import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchUI -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchUI +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat class PlayerObserver(val activity: PlayerActivity) : MPVLib.EventObserver, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt index f83843a6c..a2fc096ae 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/PlayerViewModel.kt @@ -48,10 +48,10 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.runBlocking import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.anime.interactor.GetAnime import tachiyomi.domain.entries.anime.model.Anime diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerPreferences.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerPreferences.kt index 8a6b48342..ed87c18e9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerPreferences.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerPreferences.kt @@ -5,8 +5,8 @@ import eu.kanade.tachiyomi.ui.player.viewer.AudioChannels import eu.kanade.tachiyomi.ui.player.viewer.HwDecState import eu.kanade.tachiyomi.ui.player.viewer.InvertedPlayback import eu.kanade.tachiyomi.ui.player.viewer.VideoDebanding -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.getEnum +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.getEnum class PlayerPreferences( private val preferenceStore: PreferenceStore, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerSettingsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerSettingsScreenModel.kt index e16cdb5c9..68ccc8160 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerSettingsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/PlayerSettingsScreenModel.kt @@ -27,8 +27,8 @@ import cafe.adriel.voyager.core.model.ScreenModel import dev.icerock.moko.resources.StringResource import eu.kanade.tachiyomi.ui.player.settings.dialogs.PlayerDialog import `is`.xyz.mpv.MPVLib -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.toggle +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.toggle import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.TextButton import tachiyomi.presentation.core.components.material.padding diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/dialogs/EpisodeListDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/dialogs/EpisodeListDialog.kt index 47acfcf93..9d11800a1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/dialogs/EpisodeListDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/dialogs/EpisodeListDialog.kt @@ -42,8 +42,10 @@ import tachiyomi.presentation.core.components.VerticalFastScroller import tachiyomi.presentation.core.components.material.ReadItemAlpha import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.i18n.stringResource -import java.text.DateFormat -import java.util.Date +import java.time.Instant +import java.time.LocalDate +import java.time.ZoneId +import java.time.format.DateTimeFormatter @Composable fun EpisodeListDialog( @@ -51,7 +53,7 @@ fun EpisodeListDialog( currentEpisodeIndex: Int, episodeList: List, dateRelativeTime: Boolean, - dateFormat: DateFormat, + dateFormat: DateTimeFormatter, onBookmarkClicked: (Long?, Boolean) -> Unit, onEpisodeClicked: (Long?) -> Unit, onDismissRequest: () -> Unit, @@ -92,7 +94,14 @@ fun EpisodeListDialog( val date = episode.date_upload .takeIf { it > 0L } ?.let { - Date(it).toRelativeString(context, dateRelativeTime, dateFormat) + LocalDate.ofInstant( + Instant.ofEpochMilli(it), + ZoneId.systemDefault(), + ).toRelativeString( + context = context, + relative = dateRelativeTime, + dateFormat = dateFormat, + ) } ?: "" EpisodeListItem( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/StreamsCatalogSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/StreamsCatalogSheet.kt index fc37409cd..ed5f9f9d4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/StreamsCatalogSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/StreamsCatalogSheet.kt @@ -35,7 +35,7 @@ import eu.kanade.tachiyomi.ui.player.PlayerViewModel import eu.kanade.tachiyomi.ui.player.settings.sheetDialogPadding import `is`.xyz.mpv.MPVLib import kotlinx.collections.immutable.toImmutableList -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleColorPage.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleColorPage.kt index 934ea3313..637f7feee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleColorPage.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleColorPage.kt @@ -36,8 +36,8 @@ import dev.icerock.moko.resources.StringResource import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences import eu.kanade.tachiyomi.ui.player.settings.PlayerSettingsScreenModel import `is`.xyz.mpv.MPVLib -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.getAndSet +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.getAndSet import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleFontPage.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleFontPage.kt index 177b85973..bccab3d33 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleFontPage.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleFontPage.kt @@ -32,7 +32,7 @@ import eu.kanade.presentation.components.DropdownMenu import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences import eu.kanade.tachiyomi.ui.player.settings.PlayerSettingsScreenModel import `is`.xyz.mpv.MPVLib -import tachiyomi.core.storage.extension +import tachiyomi.core.common.storage.extension import tachiyomi.domain.storage.service.StorageManager import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.OutlinedNumericChooser diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleSettingsSheet.kt index 30f4440f6..74c410fec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/settings/sheets/subtitle/SubtitleSettingsSheet.kt @@ -37,8 +37,8 @@ import eu.kanade.presentation.components.TabbedDialog import eu.kanade.presentation.components.TabbedDialogPaddings import eu.kanade.tachiyomi.ui.player.settings.PlayerSettingsScreenModel import kotlinx.collections.immutable.persistentListOf -import tachiyomi.core.storage.UniFileTempFileManager -import tachiyomi.core.storage.extension +import tachiyomi.core.common.storage.UniFileTempFileManager +import tachiyomi.core.common.storage.extension import tachiyomi.domain.storage.service.StorageManager import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.padding diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PictureInPictureHandler.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PictureInPictureHandler.kt index 25d651576..7fe10adaf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PictureInPictureHandler.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PictureInPictureHandler.kt @@ -10,7 +10,7 @@ import android.os.Build import android.util.Rational import dev.icerock.moko.resources.StringResource import eu.kanade.tachiyomi.R -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR class PictureInPictureHandler { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PlayerControlsView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PlayerControlsView.kt index f819b3cd2..d2ef3cb1f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PlayerControlsView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/PlayerControlsView.kt @@ -20,8 +20,8 @@ import eu.kanade.tachiyomi.ui.player.viewer.components.CurrentChapter import eu.kanade.tachiyomi.ui.player.viewer.components.Seekbar import `is`.xyz.mpv.MPVLib import `is`.xyz.mpv.Utils -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.withUIContext import kotlin.math.abs class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/components/DoubleTapSecondsView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/components/DoubleTapSecondsView.kt index 2990696ca..d18f9ace4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/components/DoubleTapSecondsView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/player/viewer/components/DoubleTapSecondsView.kt @@ -9,7 +9,7 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.databinding.PlayerDoubleTapSeekViewBinding -import tachiyomi.core.i18n.pluralStringResource +import tachiyomi.core.common.i18n.pluralStringResource import tachiyomi.i18n.MR /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 3d72f4557..f709692df 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -1,6 +1,7 @@ package eu.kanade.tachiyomi.ui.reader import android.annotation.SuppressLint +import android.app.Activity import android.app.assist.AssistContent import android.content.Context import android.content.Intent @@ -49,7 +50,7 @@ import eu.kanade.presentation.reader.ReadingModeSelectDialog import eu.kanade.presentation.reader.appbars.ReaderAppBars import eu.kanade.presentation.reader.settings.ReaderSettingsDialog import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.databinding.ReaderActivityBinding @@ -83,11 +84,11 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.sample import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR import tachiyomi.presentation.core.util.collectAsState import uy.kohesive.injekt.Injekt @@ -136,7 +137,16 @@ class ReaderActivity : BaseActivity() { */ override fun onCreate(savedInstanceState: Bundle?) { registerSecureActivity(this) - overridePendingTransition(R.anim.shared_axis_x_push_enter, R.anim.shared_axis_x_push_exit) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + overrideActivityTransition( + Activity.OVERRIDE_TRANSITION_OPEN, + R.anim.shared_axis_x_push_enter, + R.anim.shared_axis_x_push_exit, + ) + } else { + @Suppress("DEPRECATION") + overridePendingTransition(R.anim.shared_axis_x_push_enter, R.anim.shared_axis_x_push_exit) + } super.onCreate(savedInstanceState) @@ -273,7 +283,16 @@ class ReaderActivity : BaseActivity() { override fun finish() { viewModel.onActivityFinish() super.finish() - overridePendingTransition(R.anim.shared_axis_x_pop_enter, R.anim.shared_axis_x_pop_exit) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + overrideActivityTransition( + Activity.OVERRIDE_TRANSITION_CLOSE, + R.anim.shared_axis_x_pop_enter, + R.anim.shared_axis_x_pop_exit, + ) + } else { + @Suppress("DEPRECATION") + overridePendingTransition(R.anim.shared_axis_x_pop_enter, R.anim.shared_axis_x_pop_exit) + } } override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderNavigationOverlayView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderNavigationOverlayView.kt index a40edf8f1..9319dba7f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderNavigationOverlayView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderNavigationOverlayView.kt @@ -13,7 +13,7 @@ import androidx.core.graphics.withTranslation import androidx.core.view.isVisible import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation import eu.kanade.tachiyomi.ui.reader.viewer.navigation.DisabledNavigation -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import kotlin.math.abs class ReaderNavigationOverlayView(context: Context, attributeSet: AttributeSet) : View( 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 f78546782..5f9d2e1e1 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 @@ -54,13 +54,12 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.runBlocking import logcat.LogPriority -import tachiyomi.core.preference.toggle -import tachiyomi.core.storage.UniFileTempFileManager -import tachiyomi.core.util.lang.launchIO -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.core.common.preference.toggle +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.manga.interactor.GetManga import tachiyomi.domain.entries.manga.model.Manga @@ -86,7 +85,6 @@ class ReaderViewModel @JvmOverloads constructor( private val sourceManager: MangaSourceManager = Injekt.get(), private val downloadManager: MangaDownloadManager = Injekt.get(), private val downloadProvider: MangaDownloadProvider = Injekt.get(), - private val tempFileManager: UniFileTempFileManager = Injekt.get(), private val imageSaver: ImageSaver = Injekt.get(), preferences: BasePreferences = Injekt.get(), val readerPreferences: ReaderPreferences = Injekt.get(), @@ -277,7 +275,7 @@ class ReaderViewModel @JvmOverloads constructor( val context = Injekt.get() val source = sourceManager.getOrStub(manga.source) - loader = ChapterLoader(context, downloadManager, downloadProvider, tempFileManager, manga, source) + loader = ChapterLoader(context, downloadManager, downloadProvider, manga, source) loadChapter(loader!!, chapterList.first { chapterId == it.chapter.id }) Result.success(true) @@ -920,7 +918,6 @@ class ReaderViewModel @JvmOverloads constructor( private fun deletePendingChapters() { viewModelScope.launchNonCancellable { downloadManager.deletePendingChapters() - tempFileManager.deleteTempFiles() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt index 2676744ca..ab0146a0e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt @@ -15,7 +15,7 @@ import eu.kanade.tachiyomi.util.system.cancelNotification import eu.kanade.tachiyomi.util.system.getBitmapOrNull import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notify -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ChapterLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ChapterLoader.kt index cfff685c0..836eae1df 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ChapterLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ChapterLoader.kt @@ -8,10 +8,10 @@ import eu.kanade.tachiyomi.source.MangaSource import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.storage.UniFileTempFileManager -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.openReadOnlyChannel +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.source.manga.model.StubMangaSource import tachiyomi.i18n.MR @@ -26,7 +26,6 @@ class ChapterLoader( private val context: Context, private val downloadManager: MangaDownloadManager, private val downloadProvider: MangaDownloadProvider, - private val tempFileManager: UniFileTempFileManager, private val manga: Manga, private val source: MangaSource, ) { @@ -95,18 +94,17 @@ class ChapterLoader( source, downloadManager, downloadProvider, - tempFileManager, ) source is LocalMangaSource -> source.getFormat(chapter.chapter).let { format -> when (format) { is Format.Directory -> DirectoryPageLoader(format.file) - is Format.Zip -> ZipPageLoader(tempFileManager.createTempFile(format.file)) + is Format.Zip -> ZipPageLoader(format.file.openReadOnlyChannel(context)) is Format.Rar -> try { - RarPageLoader(tempFileManager.createTempFile(format.file)) + RarPageLoader(format.file.openInputStream()) } catch (e: UnsupportedRarV5Exception) { error(context.stringResource(MR.strings.loader_rar5_error)) } - is Format.Epub -> EpubPageLoader(tempFileManager.createTempFile(format.file)) + is Format.Epub -> EpubPageLoader(format.file.openReadOnlyChannel(context)) } } source is HttpSource -> HttpPageLoader(chapter, source) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt index 2a11f74e3..8817b0682 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DirectoryPageLoader.kt @@ -4,7 +4,7 @@ import com.hippo.unifile.UniFile import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder -import tachiyomi.core.util.system.ImageUtil +import tachiyomi.core.common.util.system.ImageUtil /** * Loader used to load a chapter from a directory given on [file]. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DownloadPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DownloadPageLoader.kt index f3d6b527b..bb8afcb24 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DownloadPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/DownloadPageLoader.kt @@ -10,7 +10,7 @@ import eu.kanade.tachiyomi.source.MangaSource import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.model.ReaderPage -import tachiyomi.core.storage.UniFileTempFileManager +import tachiyomi.core.common.storage.openReadOnlyChannel import tachiyomi.domain.entries.manga.model.Manga import uy.kohesive.injekt.injectLazy @@ -23,7 +23,6 @@ internal class DownloadPageLoader( private val source: MangaSource, private val downloadManager: MangaDownloadManager, private val downloadProvider: MangaDownloadProvider, - private val tempFileManager: UniFileTempFileManager, ) : PageLoader() { private val context: Application by injectLazy() @@ -53,7 +52,7 @@ internal class DownloadPageLoader( } private suspend fun getPagesFromArchive(file: UniFile): List { - val loader = ZipPageLoader(tempFileManager.createTempFile(file)).also { zipPageLoader = it } + val loader = ZipPageLoader(file.openReadOnlyChannel(context)).also { zipPageLoader = it } return loader.getPages() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/EpubPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/EpubPageLoader.kt index 324af51bf..baf65324b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/EpubPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/EpubPageLoader.kt @@ -3,14 +3,14 @@ package eu.kanade.tachiyomi.ui.reader.loader import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.util.storage.EpubFile -import java.io.File +import java.nio.channels.SeekableByteChannel /** * Loader used to load a chapter from a .epub file. */ -internal class EpubPageLoader(file: File) : PageLoader() { +internal class EpubPageLoader(channel: SeekableByteChannel) : PageLoader() { - private val epub = EpubFile(file) + private val epub = EpubFile(channel) override var isLocal: Boolean = true diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt index 666d46edd..bd5acafbc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt @@ -18,8 +18,8 @@ import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.flow import kotlinx.coroutines.runInterruptible import kotlinx.coroutines.suspendCancellableCoroutine -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.concurrent.PriorityBlockingQueue diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt index ad513ec93..b1db3300d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/RarPageLoader.kt @@ -5,8 +5,7 @@ import com.github.junrar.rarfile.FileHeader import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder -import tachiyomi.core.util.system.ImageUtil -import java.io.File +import tachiyomi.core.common.util.system.ImageUtil import java.io.InputStream import java.io.PipedInputStream import java.io.PipedOutputStream @@ -15,9 +14,9 @@ import java.util.concurrent.Executors /** * Loader used to load a chapter from a .rar or .cbr file. */ -internal class RarPageLoader(file: File) : PageLoader() { +internal class RarPageLoader(inputStream: InputStream) : PageLoader() { - private val rar = Archive(file) + private val rar = Archive(inputStream) override var isLocal: Boolean = true diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt index e4fd1c6e5..fadba25c4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt @@ -3,22 +3,21 @@ package eu.kanade.tachiyomi.ui.reader.loader import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder -import tachiyomi.core.util.system.ImageUtil -import java.io.File -import java.nio.charset.StandardCharsets -import java.util.zip.ZipFile +import org.apache.commons.compress.archivers.zip.ZipFile +import tachiyomi.core.common.util.system.ImageUtil +import java.nio.channels.SeekableByteChannel /** * Loader used to load a chapter from a .zip or .cbz file. */ -internal class ZipPageLoader(file: File) : PageLoader() { +internal class ZipPageLoader(channel: SeekableByteChannel) : PageLoader() { - private val zip = ZipFile(file, StandardCharsets.ISO_8859_1) + private val zip = ZipFile(channel) override var isLocal: Boolean = true override suspend fun getPages(): List { - return zip.entries().asSequence() + return zip.entries.asSequence() .filter { !it.isDirectory && ImageUtil.isImage(it.name) { zip.getInputStream(it) } } .sortedWith { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder(f2.name) } .mapIndexed { i, entry -> diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt index 3cda0474a..4728d8e15 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt @@ -4,7 +4,7 @@ import eu.kanade.domain.items.chapter.model.toDbChapter import eu.kanade.tachiyomi.data.database.models.manga.Chapter import eu.kanade.tachiyomi.ui.reader.loader.PageLoader import kotlinx.coroutines.flow.MutableStateFlow -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat data class ReaderChapter(val chapter: Chapter) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt index 95faea7d1..1e6c61b68 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt @@ -3,8 +3,8 @@ package eu.kanade.tachiyomi.ui.reader.setting import android.os.Build import androidx.compose.ui.graphics.BlendMode import dev.icerock.moko.resources.StringResource -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.getEnum +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.getEnum import tachiyomi.i18n.MR class ReaderPreferences( @@ -83,6 +83,8 @@ class ReaderPreferences( fun skipDupe() = preferenceStore.getBoolean("skip_dupe", false) + fun webtoonDisableZoomOut() = preferenceStore.getBoolean("webtoon_disable_zoom_out", false) + // endregion // region Split two page spread diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerConfig.kt index 44dd19db4..0d973d239 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerConfig.kt @@ -5,7 +5,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach -import tachiyomi.core.preference.Preference +import tachiyomi.core.common.preference.Preference /** * Common configuration for all viewers. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt index 16b04093e..cbf53afbe 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt @@ -18,11 +18,11 @@ import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import kotlinx.coroutines.supervisorScope import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.ImageUtil -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.ImageUtil +import tachiyomi.core.common.util.system.logcat import java.io.BufferedInputStream import java.io.ByteArrayInputStream import java.io.InputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt index 6adb5fcef..4569f4370 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerTransitionHolder.kt @@ -20,7 +20,7 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.MainScope import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt index 69830ff99..2206370c2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt @@ -21,7 +21,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.Viewer import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation.NavigationRegion import kotlinx.coroutines.MainScope import kotlinx.coroutines.cancel -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.injectLazy import kotlin.math.min diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt index ec78dc8c6..5ff4ecaae 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt @@ -10,7 +10,7 @@ import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters import eu.kanade.tachiyomi.ui.reader.viewer.calculateChapterGap import eu.kanade.tachiyomi.util.system.createReaderThemeContext import eu.kanade.tachiyomi.widget.ViewPagerAdapter -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat /** * Pager adapter used by this [viewer] to where [ViewerChapters] updates are posted. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt index 28ad91a51..164c4939d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt @@ -29,6 +29,11 @@ class WebtoonConfig( var imageCropBorders = false private set + var zoomOutDisabled = false + private set + + var zoomPropertyChangedListener: ((Boolean) -> Unit)? = null + var sidePadding = 0 private set @@ -74,6 +79,12 @@ class WebtoonConfig( { imagePropertyChangedListener?.invoke() }, ) + readerPreferences.webtoonDisableZoomOut() + .register( + { zoomOutDisabled = it }, + { zoomPropertyChangedListener?.invoke(it) }, + ) + readerPreferences.webtoonDoubleTapZoomEnabled() .register( { doubleTapZoom = it }, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt index 572335b25..17aafc6fd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt @@ -33,6 +33,12 @@ class WebtoonFrame(context: Context) : FrameLayout(context) { scaleDetector.isQuickScaleEnabled = value } + var zoomOutDisabled = false + set(value) { + field = value + recycler?.zoomOutDisabled = value + } + /** * Recycler view added in this frame. */ diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt index c8aa04057..7b16de2a9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt @@ -24,11 +24,11 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.supervisorScope import kotlinx.coroutines.suspendCancellableCoroutine import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.lang.withUIContext -import tachiyomi.core.util.system.ImageUtil -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withUIContext +import tachiyomi.core.common.util.system.ImageUtil +import tachiyomi.core.common.util.system.logcat import java.io.BufferedInputStream import java.io.InputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt index 5e973d124..f4703ce8a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt @@ -33,6 +33,15 @@ class WebtoonRecyclerView @JvmOverloads constructor( private var firstVisibleItemPosition = 0 private var lastVisibleItemPosition = 0 private var currentScale = DEFAULT_RATE + var zoomOutDisabled = false + set(value) { + field = value + if (value && currentScale < DEFAULT_RATE) { + zoom(currentScale, DEFAULT_RATE, x, 0f, y, 0f) + } + } + private val minRate + get() = if (zoomOutDisabled) DEFAULT_RATE else MIN_RATE private val listener = GestureListener() private val detector = Detector() @@ -174,7 +183,7 @@ class WebtoonRecyclerView @JvmOverloads constructor( fun onScale(scaleFactor: Float) { currentScale *= scaleFactor currentScale = currentScale.coerceIn( - MIN_RATE, + minRate, MAX_SCALE_RATE, ) @@ -201,8 +210,8 @@ class WebtoonRecyclerView @JvmOverloads constructor( } fun onScaleEnd() { - if (scaleX < MIN_RATE) { - zoom(currentScale, MIN_RATE, x, 0f, y, 0f) + if (scaleX < minRate) { + zoom(currentScale, minRate, x, 0f, y, 0f) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt index 65629799e..57036d070 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonTransitionHolder.kt @@ -17,7 +17,7 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.MainScope import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt index 9737f22df..1542883f3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt @@ -21,7 +21,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.Viewer import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation.NavigationRegion import kotlinx.coroutines.MainScope import kotlinx.coroutines.cancel -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy @@ -152,6 +152,10 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr frame.doubleTapZoom = it } + config.zoomPropertyChangedListener = { + frame.zoomOutDisabled = it + } + config.navigationModeChangedListener = { val showOnStart = config.navigationOverlayOnStart || config.forceNavigationOverlay activity.binding.navigationOverlay.setNavigation(config.navigator, showOnStart) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/security/UnlockActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/security/UnlockActivity.kt index 557da5bdd..00d1e136a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/security/UnlockActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/security/UnlockActivity.kt @@ -8,8 +8,8 @@ import eu.kanade.tachiyomi.ui.base.delegate.SecureActivityDelegate import eu.kanade.tachiyomi.util.system.AuthenticatorUtil import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.startAuthentication import logcat.LogPriority -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/TrackLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/TrackLoginActivity.kt index 250616cc9..055611e19 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/TrackLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/TrackLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting.track import android.net.Uri import androidx.lifecycle.lifecycleScope -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO class TrackLoginActivity : BaseOAuthLoginActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/anime/AnimeStatsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/anime/AnimeStatsScreenModel.kt index e29a8ac65..d82f3af6a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/anime/AnimeStatsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/anime/AnimeStatsScreenModel.kt @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager import eu.kanade.tachiyomi.data.track.AnimeTracker import eu.kanade.tachiyomi.data.track.TrackerManager import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.entries.anime.interactor.GetLibraryAnime import tachiyomi.domain.items.episode.interactor.GetEpisodesByAnimeId import tachiyomi.domain.library.anime.LibraryAnime diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/manga/MangaStatsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/manga/MangaStatsScreenModel.kt index 5c8f1fc18..836126a88 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/manga/MangaStatsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/manga/MangaStatsScreenModel.kt @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.data.track.MangaTracker import eu.kanade.tachiyomi.data.track.TrackerManager import eu.kanade.tachiyomi.source.model.SManga import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.entries.manga.interactor.GetLibraryManga import tachiyomi.domain.history.manga.interactor.GetTotalReadDuration import tachiyomi.domain.library.manga.LibraryManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/storage/CommonStorageScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/storage/CommonStorageScreenModel.kt index 173c0a82f..96cecec46 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/storage/CommonStorageScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/storage/CommonStorageScreenModel.kt @@ -12,7 +12,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.update -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.service.LibraryPreferences import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/storage/anime/AnimeStorageScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/storage/anime/AnimeStorageScreenModel.kt index 87f825a34..ad2724945 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/storage/anime/AnimeStorageScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/storage/anime/AnimeStorageScreenModel.kt @@ -4,7 +4,7 @@ import cafe.adriel.voyager.core.model.screenModelScope import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadCache import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager import eu.kanade.tachiyomi.ui.storage.CommonStorageScreenModel -import tachiyomi.core.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.launchNonCancellable import tachiyomi.domain.category.anime.interactor.GetAnimeCategories import tachiyomi.domain.category.anime.interactor.GetVisibleAnimeCategories import tachiyomi.domain.entries.anime.interactor.GetLibraryAnime diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/storage/manga/MangaStorageScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/storage/manga/MangaStorageScreenModel.kt index d5ff2e1d9..1113f2b03 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/storage/manga/MangaStorageScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/storage/manga/MangaStorageScreenModel.kt @@ -4,7 +4,7 @@ import cafe.adriel.voyager.core.model.screenModelScope import eu.kanade.tachiyomi.data.download.manga.MangaDownloadCache import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager import eu.kanade.tachiyomi.ui.storage.CommonStorageScreenModel -import tachiyomi.core.util.lang.launchNonCancellable +import tachiyomi.core.common.util.lang.launchNonCancellable import tachiyomi.domain.category.manga.interactor.GetMangaCategories import tachiyomi.domain.category.manga.interactor.GetVisibleMangaCategories import tachiyomi.domain.entries.manga.interactor.GetLibraryManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesScreenModel.kt index e111389d6..daec3dac0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesScreenModel.kt @@ -16,7 +16,7 @@ import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadCache import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload import eu.kanade.tachiyomi.data.library.anime.AnimeLibraryUpdateJob -import eu.kanade.tachiyomi.util.lang.toDateKey +import eu.kanade.tachiyomi.util.lang.toLocalDate import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.mutate import kotlinx.collections.immutable.persistentListOf @@ -32,9 +32,9 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.entries.anime.interactor.GetAnime import tachiyomi.domain.items.episode.interactor.GetEpisode @@ -47,7 +47,6 @@ import tachiyomi.domain.updates.anime.model.AnimeUpdatesWithRelations import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.time.ZonedDateTime -import java.util.Date class AnimeUpdatesScreenModel( private val sourceManager: AnimeSourceManager = Injekt.get(), @@ -393,12 +392,10 @@ class AnimeUpdatesScreenModel( return items .map { AnimeUpdatesUiModel.Item(it) } .insertSeparators { before, after -> - val beforeDate = before?.item?.update?.dateFetch?.toDateKey() ?: Date(0) - val afterDate = after?.item?.update?.dateFetch?.toDateKey() ?: Date(0) + val beforeDate = before?.item?.update?.dateFetch?.toLocalDate() + val afterDate = after?.item?.update?.dateFetch?.toLocalDate() when { - beforeDate.time != afterDate.time && afterDate.time != 0L -> { - AnimeUpdatesUiModel.Header(afterDate) - } + beforeDate != afterDate && afterDate != null -> AnimeUpdatesUiModel.Header(afterDate) // Return null to avoid adding a separator between two items. else -> null } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesTab.kt index e2039a637..1d61fafe4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/anime/AnimeUpdatesTab.kt @@ -28,8 +28,8 @@ import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.launchIO import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesScreenModel.kt index b897528b0..0b21e3ed1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesScreenModel.kt @@ -16,7 +16,7 @@ import eu.kanade.tachiyomi.data.download.manga.MangaDownloadCache import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager import eu.kanade.tachiyomi.data.download.manga.model.MangaDownload import eu.kanade.tachiyomi.data.library.manga.MangaLibraryUpdateJob -import eu.kanade.tachiyomi.util.lang.toDateKey +import eu.kanade.tachiyomi.util.lang.toLocalDate import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.mutate import kotlinx.collections.immutable.persistentListOf @@ -32,9 +32,9 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority -import tachiyomi.core.util.lang.launchIO -import tachiyomi.core.util.lang.launchNonCancellable -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.launchIO +import tachiyomi.core.common.util.lang.launchNonCancellable +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.interactor.GetManga import tachiyomi.domain.items.chapter.interactor.GetChapter import tachiyomi.domain.items.chapter.interactor.UpdateChapter @@ -46,7 +46,6 @@ import tachiyomi.domain.updates.manga.model.MangaUpdatesWithRelations import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.time.ZonedDateTime -import java.util.Date class MangaUpdatesScreenModel( private val sourceManager: MangaSourceManager = Injekt.get(), @@ -374,12 +373,10 @@ class MangaUpdatesScreenModel( return items .map { MangaUpdatesUiModel.Item(it) } .insertSeparators { before, after -> - val beforeDate = before?.item?.update?.dateFetch?.toDateKey() ?: Date(0) - val afterDate = after?.item?.update?.dateFetch?.toDateKey() ?: Date(0) + val beforeDate = before?.item?.update?.dateFetch?.toLocalDate() + val afterDate = after?.item?.update?.dateFetch?.toLocalDate() when { - beforeDate.time != afterDate.time && afterDate.time != 0L -> { - MangaUpdatesUiModel.Header(afterDate) - } + beforeDate != afterDate && afterDate != null -> MangaUpdatesUiModel.Header(afterDate) // Return null to avoid adding a separator between two items. else -> null } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesTab.kt index 9573d4b10..118371d42 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/manga/MangaUpdatesTab.kt @@ -26,7 +26,7 @@ import eu.kanade.tachiyomi.ui.reader.ReaderActivity import kotlinx.collections.immutable.persistentListOf import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt index ccf49ccb3..c07afb293 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt @@ -1,8 +1,10 @@ package eu.kanade.tachiyomi.ui.webview +import android.app.Activity import android.app.assist.AssistContent import android.content.Context import android.content.Intent +import android.os.Build import android.os.Bundle import android.widget.Toast import androidx.core.net.toUri @@ -19,7 +21,7 @@ import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.view.setComposeContent import logcat.LogPriority import okhttp3.HttpUrl.Companion.toHttpUrl -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.anime.service.AnimeSourceManager import tachiyomi.domain.source.manga.service.MangaSourceManager import tachiyomi.i18n.MR @@ -38,7 +40,16 @@ class WebViewActivity : BaseActivity() { } override fun onCreate(savedInstanceState: Bundle?) { - overridePendingTransition(R.anim.shared_axis_x_push_enter, R.anim.shared_axis_x_push_exit) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + overrideActivityTransition( + Activity.OVERRIDE_TRANSITION_OPEN, + R.anim.shared_axis_x_push_enter, + R.anim.shared_axis_x_push_exit, + ) + } else { + @Suppress("DEPRECATION") + overridePendingTransition(R.anim.shared_axis_x_push_enter, R.anim.shared_axis_x_push_exit) + } super.onCreate(savedInstanceState) if (!WebViewUtil.supportsWebView(this)) { @@ -86,7 +97,16 @@ class WebViewActivity : BaseActivity() { override fun finish() { super.finish() - overridePendingTransition(R.anim.shared_axis_x_pop_enter, R.anim.shared_axis_x_pop_exit) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + overrideActivityTransition( + Activity.OVERRIDE_TRANSITION_CLOSE, + R.anim.shared_axis_x_pop_enter, + R.anim.shared_axis_x_pop_exit, + ) + } else { + @Suppress("DEPRECATION") + overridePendingTransition(R.anim.shared_axis_x_pop_enter, R.anim.shared_axis_x_pop_exit) + } } private fun shareWebpage(url: String) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt index 535296c5c..38dca6ac3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewScreenModel.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import logcat.LogPriority import okhttp3.HttpUrl.Companion.toHttpUrl -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.source.anime.service.AnimeSourceManager import tachiyomi.domain.source.manga.service.MangaSourceManager import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/AniChartApi.kt b/app/src/main/java/eu/kanade/tachiyomi/util/AniChartApi.kt index b2151e8e7..9fe62c031 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/AniChartApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/AniChartApi.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.entries.anime.model.Anime import java.time.OffsetDateTime import java.util.Calendar diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/AniSkipApi.kt b/app/src/main/java/eu/kanade/tachiyomi/util/AniSkipApi.kt index 4ff2ec5d3..cf475e0b8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/AniSkipApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/AniSkipApi.kt @@ -17,8 +17,8 @@ import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.put import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.lang.withUIContext import tachiyomi.i18n.MR import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/CrashLogUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/CrashLogUtil.kt index ef3bfca55..4eb57d0a1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/CrashLogUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/CrashLogUtil.kt @@ -11,8 +11,8 @@ import eu.kanade.tachiyomi.util.system.createFileInCacheDir import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import `is`.xyz.mpv.Utils -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.lang.withUIContext import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt index 70a87cbba..cad60ee75 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/lang/DateExtensions.kt @@ -2,19 +2,23 @@ package eu.kanade.tachiyomi.util.lang import android.content.Context import eu.kanade.tachiyomi.R -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.pluralStringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import java.text.DateFormat import java.time.Instant +import java.time.LocalDate import java.time.LocalDateTime import java.time.ZoneId +import java.time.format.DateTimeFormatter +import java.time.format.FormatStyle import java.time.temporal.ChronoUnit -import java.util.Calendar import java.util.Date +import kotlin.math.absoluteValue -fun Date.toDateTimestampString(dateFormatter: DateFormat): String { - val date = dateFormatter.format(this) - val time = DateFormat.getTimeInstance(DateFormat.SHORT).format(this) +fun LocalDateTime.toDateTimestampString(dateTimeFormatter: DateTimeFormatter): String { + val date = dateTimeFormatter.format(this) + val time = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT).format(this) return "$date $time" } @@ -32,52 +36,35 @@ fun Long.convertEpochMillisZone( .toEpochMilli() } -/** - * Get date as time key - * - * @param date desired date - * @return date as time key - */ -fun Long.toDateKey(): Date { - val instant = Instant.ofEpochMilli(this) - return Date.from(instant.truncatedTo(ChronoUnit.DAYS)) +fun Long.toLocalDate(): LocalDate { + return LocalDate.ofInstant(Instant.ofEpochMilli(this), ZoneId.systemDefault()) } -fun Date.toRelativeString( +fun LocalDate.toRelativeString( context: Context, relative: Boolean = true, - dateFormat: DateFormat = DateFormat.getDateInstance(DateFormat.SHORT), + dateFormat: DateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT), ): String { if (!relative) { return dateFormat.format(this) } - val now = Date() - val difference = now.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY) - - this.timeWithOffset.floorNearest(MILLISECONDS_IN_DAY) - val days = difference.floorDiv(MILLISECONDS_IN_DAY).toInt() + val now = LocalDate.now() + val difference = ChronoUnit.DAYS.between(this, now) return when { - difference < 0 -> dateFormat.format(this) - difference < MILLISECONDS_IN_DAY -> context.stringResource(MR.strings.relative_time_today) - difference < MILLISECONDS_IN_DAY.times(7) -> context.resources.getQuantityString( - R.plurals.relative_time, - days, - days, + difference < -7 -> dateFormat.format(this) + difference < 0 -> context.pluralStringResource( + MR.plurals.upcoming_relative_time, + difference.toInt().absoluteValue, + difference.toInt().absoluteValue, ) + + difference < 1 -> context.stringResource(MR.strings.relative_time_today) + difference < 7 -> context.resources.getQuantityString( + R.plurals.relative_time, + difference.toInt(), + difference.toInt(), + ) + else -> dateFormat.format(this) } } - -private const val MILLISECONDS_IN_DAY = 86_400_000L - -private val Date.timeWithOffset: Long - get() { - return Calendar.getInstance().run { - time = this@timeWithOffset - val dstOffset = get(Calendar.DST_OFFSET) - this@timeWithOffset.time + timeZone.rawOffset + dstOffset - } - } - -private fun Long.floorNearest(to: Long): Long { - return this.floorDiv(to) * to -} diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/AuthenticatorUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/AuthenticatorUtil.kt index ce3a09141..164a1075c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/AuthenticatorUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/AuthenticatorUtil.kt @@ -11,7 +11,7 @@ import androidx.biometric.auth.startClass2BiometricOrCredentialAuthentication import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity import kotlinx.coroutines.suspendCancellableCoroutine -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import kotlin.coroutines.resume diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ChildFirstPathClassLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ChildFirstPathClassLoader.kt new file mode 100644 index 000000000..0823e765d --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ChildFirstPathClassLoader.kt @@ -0,0 +1,86 @@ +package eu.kanade.tachiyomi.util.system + +import dalvik.system.PathClassLoader +import java.io.IOException +import java.io.InputStream +import java.net.URL +import java.util.Enumeration + +/** + * A parent-last class loader that will try in order: + * - the system class loader + * - the child class loader + * - the parent class loader. + */ +class ChildFirstPathClassLoader( + dexPath: String, + librarySearchPath: String?, + parent: ClassLoader, +) : PathClassLoader(dexPath, librarySearchPath, parent) { + + private val systemClassLoader: ClassLoader? = getSystemClassLoader() + + override fun loadClass(name: String?, resolve: Boolean): Class<*> { + var c = findLoadedClass(name) + + if (c == null && systemClassLoader != null) { + try { + c = systemClassLoader.loadClass(name) + } catch (_: ClassNotFoundException) {} + } + + if (c == null) { + c = try { + findClass(name) + } catch (_: ClassNotFoundException) { + super.loadClass(name, resolve) + } + } + + if (resolve) { + resolveClass(c) + } + + return c + } + + override fun getResource(name: String?): URL? { + return systemClassLoader?.getResource(name) + ?: findResource(name) + ?: super.getResource(name) + } + + override fun getResources(name: String?): Enumeration { + val systemUrls = systemClassLoader?.getResources(name) + val localUrls = findResources(name) + val parentUrls = parent?.getResources(name) + val urls = buildList { + while (systemUrls?.hasMoreElements() == true) { + add(systemUrls.nextElement()) + } + + while (localUrls?.hasMoreElements() == true) { + add(localUrls.nextElement()) + } + + while (parentUrls?.hasMoreElements() == true) { + add(parentUrls.nextElement()) + } + } + + return object : Enumeration { + val iterator = urls.iterator() + + override fun hasMoreElements() = iterator.hasNext() + override fun nextElement() = iterator.next() + } + } + + override fun getResourceAsStream(name: String?): InputStream? { + return try { + getResource(name)?.openStream() + } catch (_: IOException) { + return null + } + } +} diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt index 57ac676af..85a53bf1d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt @@ -23,8 +23,8 @@ import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.util.lang.truncateCenter import logcat.LogPriority import rikka.sui.Sui -import tachiyomi.core.i18n.stringResource -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.util.system.logcat import tachiyomi.i18n.MR import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt index ed4ce04f5..65acbed18 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/IntentExtensions.kt @@ -6,7 +6,7 @@ import android.content.Intent import android.net.Uri import android.os.Build import androidx.core.content.IntentCompat -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import java.io.Serializable diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt index eb27028d0..f0fb7ea2d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.util.system import android.content.Context import androidx.core.os.LocaleListCompat -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import java.util.Locale diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/WorkManagerExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/WorkManagerExtensions.kt index e565921db..a31857c0f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/WorkManagerExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/WorkManagerExtensions.kt @@ -6,7 +6,7 @@ import androidx.work.WorkInfo import androidx.work.WorkManager import kotlinx.coroutines.delay import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat val Context.workManager: WorkManager get() = WorkManager.getInstance(this) diff --git a/core/.gitignore b/core/common/.gitignore similarity index 100% rename from core/.gitignore rename to core/common/.gitignore diff --git a/core/build.gradle.kts b/core/common/build.gradle.kts similarity index 92% rename from core/build.gradle.kts rename to core/common/build.gradle.kts index 1e83ca222..aaaf9ac07 100644 --- a/core/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } android { - namespace = "eu.kanade.tachiyomi.core" + namespace = "eu.kanade.tachiyomi.core.common" kotlinOptions { freeCompilerArgs += listOf( @@ -32,6 +32,7 @@ dependencies { implementation(libs.image.decoder) implementation(libs.unifile) + implementation(libs.bundles.archive) api(kotlinx.coroutines.core) api(kotlinx.serialization.json) diff --git a/core/src/main/AndroidManifest.xml b/core/common/src/main/AndroidManifest.xml similarity index 100% rename from core/src/main/AndroidManifest.xml rename to core/common/src/main/AndroidManifest.xml diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/Constants.kt b/core/common/src/main/java/eu/kanade/tachiyomi/core/Constants.kt similarity index 96% rename from core/src/main/java/eu/kanade/tachiyomi/core/Constants.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/core/Constants.kt index 98f8ae2f4..24883481d 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/Constants.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/core/Constants.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.core +package eu.kanade.tachiyomi.core.common object Constants { const val URL_HELP = "https://aniyomi.org/docs/guides/troubleshooting/" diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt b/core/common/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt similarity index 86% rename from core/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt index faf268314..274f0c592 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt @@ -1,9 +1,9 @@ package eu.kanade.tachiyomi.core.security import dev.icerock.moko.resources.StringResource -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.getEnum +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.getEnum import tachiyomi.i18n.MR class SecurityPreferences( diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/AndroidCookieJar.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/DohProviders.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt similarity index 92% rename from core/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt index 4ecf3e09d..5c7894606 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.network import android.content.Context import app.cash.quickjs.QuickJs -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext /** * Util for evaluating JavaScript in sources. diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/NetworkHelper.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt similarity index 85% rename from core/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt index 7cf5abf06..c32864aec 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.network -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore class NetworkPreferences( private val preferenceStore: PreferenceStore, diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/ProgressListener.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/ProgressListener.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/ProgressListener.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/ProgressListener.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/ProgressResponseBody.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/Requests.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/Requests.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/Requests.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/Requests.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt similarity index 99% rename from core/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt index 03c06aac7..9a6ccbb50 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt @@ -14,7 +14,7 @@ import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.Interceptor import okhttp3.Request import okhttp3.Response -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import java.io.IOException import java.util.concurrent.CountDownLatch diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/IgnoreGzipInterceptor.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/IgnoreGzipInterceptor.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/interceptor/IgnoreGzipInterceptor.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/IgnoreGzipInterceptor.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/RateLimitInterceptor.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/SpecificHostRateLimitInterceptor.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/SpecificHostRateLimitInterceptor.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/interceptor/SpecificHostRateLimitInterceptor.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/SpecificHostRateLimitInterceptor.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/UncaughtExceptionInterceptor.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/UncaughtExceptionInterceptor.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/interceptor/UncaughtExceptionInterceptor.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/UncaughtExceptionInterceptor.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/UserAgentInterceptor.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/UserAgentInterceptor.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/network/interceptor/UserAgentInterceptor.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/UserAgentInterceptor.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt similarity index 98% rename from core/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt index ea37db51b..d72aa7337 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt @@ -14,7 +14,7 @@ import okhttp3.Headers import okhttp3.Interceptor import okhttp3.Request import okhttp3.Response -import tachiyomi.core.util.lang.launchUI +import tachiyomi.core.common.util.lang.launchUI import tachiyomi.i18n.MR import java.util.Locale import java.util.concurrent.CountDownLatch diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/lang/Hash.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/lang/Hash.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/util/lang/Hash.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/lang/Hash.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/lang/StringExtensions.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/storage/DiskUtil.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/storage/EpubFile.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/storage/EpubFile.kt similarity index 92% rename from core/src/main/java/eu/kanade/tachiyomi/util/storage/EpubFile.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/storage/EpubFile.kt index a00ee69e7..f664c175b 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/storage/EpubFile.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/util/storage/EpubFile.kt @@ -1,22 +1,23 @@ package eu.kanade.tachiyomi.util.storage +import org.apache.commons.compress.archivers.zip.ZipArchiveEntry +import org.apache.commons.compress.archivers.zip.ZipFile import org.jsoup.Jsoup import org.jsoup.nodes.Document import java.io.Closeable import java.io.File import java.io.InputStream -import java.util.zip.ZipEntry -import java.util.zip.ZipFile +import java.nio.channels.SeekableByteChannel /** * Wrapper over ZipFile to load files in epub format. */ -class EpubFile(file: File) : Closeable { +class EpubFile(channel: SeekableByteChannel) : Closeable { /** * Zip file of this epub. */ - private val zip = ZipFile(file) + private val zip = ZipFile(channel) /** * Path separator used by this epub. @@ -33,14 +34,14 @@ class EpubFile(file: File) : Closeable { /** * Returns an input stream for reading the contents of the specified zip file entry. */ - fun getInputStream(entry: ZipEntry): InputStream { + fun getInputStream(entry: ZipArchiveEntry): InputStream { return zip.getInputStream(entry) } /** * Returns the zip file entry for the specified name, or null if not found. */ - fun getEntry(name: String): ZipEntry? { + fun getEntry(name: String): ZipArchiveEntry? { return zip.getEntry(name) } diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/storage/FileExtensions.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/storage/FileExtensions.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/util/storage/FileExtensions.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/storage/FileExtensions.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/system/DensityExtensions.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt similarity index 98% rename from core/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt index e2011f0c5..c9f20326d 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt @@ -6,7 +6,7 @@ import android.content.Context import android.os.Build import androidx.core.content.getSystemService import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat object DeviceUtil { diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/ToastExtensions.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/ToastExtensions.kt similarity index 94% rename from core/src/main/java/eu/kanade/tachiyomi/util/system/ToastExtensions.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/system/ToastExtensions.kt index 5089db233..21b8c39cc 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/system/ToastExtensions.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/ToastExtensions.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.util.system import android.content.Context import android.widget.Toast import dev.icerock.moko.resources.StringResource -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource /** * Display a toast in this context. diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt similarity index 100% rename from core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/system/WebViewClientCompat.kt diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt similarity index 98% rename from core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt rename to core/common/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt index 42b756f74..b059e15d4 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt +++ b/core/common/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt @@ -8,7 +8,7 @@ import android.webkit.WebSettings import android.webkit.WebView import kotlinx.coroutines.suspendCancellableCoroutine import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import kotlin.coroutines.resume object WebViewUtil { diff --git a/core/src/main/java/tachiyomi/core/i18n/Localize.kt b/core/common/src/main/java/tachiyomi/core/common/i18n/Localize.kt similarity index 97% rename from core/src/main/java/tachiyomi/core/i18n/Localize.kt rename to core/common/src/main/java/tachiyomi/core/common/i18n/Localize.kt index d6f8f3c16..c698e856e 100644 --- a/core/src/main/java/tachiyomi/core/i18n/Localize.kt +++ b/core/common/src/main/java/tachiyomi/core/common/i18n/Localize.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.i18n +package tachiyomi.core.common.i18n import android.content.Context import dev.icerock.moko.resources.PluralsResource diff --git a/core/src/main/java/tachiyomi/core/preference/AndroidPreference.kt b/core/common/src/main/java/tachiyomi/core/common/preference/AndroidPreference.kt similarity index 98% rename from core/src/main/java/tachiyomi/core/preference/AndroidPreference.kt rename to core/common/src/main/java/tachiyomi/core/common/preference/AndroidPreference.kt index 21f5b1d30..577d83687 100644 --- a/core/src/main/java/tachiyomi/core/preference/AndroidPreference.kt +++ b/core/common/src/main/java/tachiyomi/core/common/preference/AndroidPreference.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.preference +package tachiyomi.core.common.preference import android.content.SharedPreferences import android.content.SharedPreferences.Editor @@ -12,7 +12,7 @@ import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.stateIn -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat sealed class AndroidPreference( private val preferences: SharedPreferences, diff --git a/core/src/main/java/tachiyomi/core/preference/AndroidPreferenceStore.kt b/core/common/src/main/java/tachiyomi/core/common/preference/AndroidPreferenceStore.kt similarity index 81% rename from core/src/main/java/tachiyomi/core/preference/AndroidPreferenceStore.kt rename to core/common/src/main/java/tachiyomi/core/common/preference/AndroidPreferenceStore.kt index b24fa5dcc..6bdb120cd 100644 --- a/core/src/main/java/tachiyomi/core/preference/AndroidPreferenceStore.kt +++ b/core/common/src/main/java/tachiyomi/core/common/preference/AndroidPreferenceStore.kt @@ -1,17 +1,17 @@ -package tachiyomi.core.preference +package tachiyomi.core.common.preference import android.content.Context import android.content.SharedPreferences import androidx.preference.PreferenceManager import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.callbackFlow -import tachiyomi.core.preference.AndroidPreference.BooleanPrimitive -import tachiyomi.core.preference.AndroidPreference.FloatPrimitive -import tachiyomi.core.preference.AndroidPreference.IntPrimitive -import tachiyomi.core.preference.AndroidPreference.LongPrimitive -import tachiyomi.core.preference.AndroidPreference.Object -import tachiyomi.core.preference.AndroidPreference.StringPrimitive -import tachiyomi.core.preference.AndroidPreference.StringSetPrimitive +import tachiyomi.core.common.preference.AndroidPreference.BooleanPrimitive +import tachiyomi.core.common.preference.AndroidPreference.FloatPrimitive +import tachiyomi.core.common.preference.AndroidPreference.IntPrimitive +import tachiyomi.core.common.preference.AndroidPreference.LongPrimitive +import tachiyomi.core.common.preference.AndroidPreference.Object +import tachiyomi.core.common.preference.AndroidPreference.StringPrimitive +import tachiyomi.core.common.preference.AndroidPreference.StringSetPrimitive class AndroidPreferenceStore( context: Context, diff --git a/core/src/main/java/tachiyomi/core/preference/CheckboxState.kt b/core/common/src/main/java/tachiyomi/core/common/preference/CheckboxState.kt similarity index 97% rename from core/src/main/java/tachiyomi/core/preference/CheckboxState.kt rename to core/common/src/main/java/tachiyomi/core/common/preference/CheckboxState.kt index da681e16d..cf7e471c0 100644 --- a/core/src/main/java/tachiyomi/core/preference/CheckboxState.kt +++ b/core/common/src/main/java/tachiyomi/core/common/preference/CheckboxState.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.preference +package tachiyomi.core.common.preference sealed class CheckboxState(open val value: T) { diff --git a/core/src/main/java/tachiyomi/core/preference/InMemoryPreferenceStore.kt b/core/common/src/main/java/tachiyomi/core/common/preference/InMemoryPreferenceStore.kt similarity index 98% rename from core/src/main/java/tachiyomi/core/preference/InMemoryPreferenceStore.kt rename to core/common/src/main/java/tachiyomi/core/common/preference/InMemoryPreferenceStore.kt index 2fb3ee9ec..96e8644ad 100644 --- a/core/src/main/java/tachiyomi/core/preference/InMemoryPreferenceStore.kt +++ b/core/common/src/main/java/tachiyomi/core/common/preference/InMemoryPreferenceStore.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.preference +package tachiyomi.core.common.preference import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow diff --git a/core/src/main/java/tachiyomi/core/preference/Preference.kt b/core/common/src/main/java/tachiyomi/core/common/preference/Preference.kt similarity index 97% rename from core/src/main/java/tachiyomi/core/preference/Preference.kt rename to core/common/src/main/java/tachiyomi/core/common/preference/Preference.kt index 1cc0d3d3c..d5b6b564f 100644 --- a/core/src/main/java/tachiyomi/core/preference/Preference.kt +++ b/core/common/src/main/java/tachiyomi/core/common/preference/Preference.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.preference +package tachiyomi.core.common.preference import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow diff --git a/core/src/main/java/tachiyomi/core/preference/PreferenceStore.kt b/core/common/src/main/java/tachiyomi/core/common/preference/PreferenceStore.kt similarity index 96% rename from core/src/main/java/tachiyomi/core/preference/PreferenceStore.kt rename to core/common/src/main/java/tachiyomi/core/common/preference/PreferenceStore.kt index 5b0e9da9b..0cd3a21bf 100644 --- a/core/src/main/java/tachiyomi/core/preference/PreferenceStore.kt +++ b/core/common/src/main/java/tachiyomi/core/common/preference/PreferenceStore.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.preference +package tachiyomi.core.common.preference interface PreferenceStore { diff --git a/core/src/main/java/tachiyomi/core/preference/TriState.kt b/core/common/src/main/java/tachiyomi/core/common/preference/TriState.kt similarity index 89% rename from core/src/main/java/tachiyomi/core/preference/TriState.kt rename to core/common/src/main/java/tachiyomi/core/common/preference/TriState.kt index 68b9173ce..703f069c3 100644 --- a/core/src/main/java/tachiyomi/core/preference/TriState.kt +++ b/core/common/src/main/java/tachiyomi/core/common/preference/TriState.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.preference +package tachiyomi.core.common.preference enum class TriState { DISABLED, // Disable filter diff --git a/core/src/main/java/tachiyomi/core/storage/AndroidStorageFolderProvider.kt b/core/common/src/main/java/tachiyomi/core/common/storage/AndroidStorageFolderProvider.kt similarity index 86% rename from core/src/main/java/tachiyomi/core/storage/AndroidStorageFolderProvider.kt rename to core/common/src/main/java/tachiyomi/core/common/storage/AndroidStorageFolderProvider.kt index a5d48a49d..33335f345 100644 --- a/core/src/main/java/tachiyomi/core/storage/AndroidStorageFolderProvider.kt +++ b/core/common/src/main/java/tachiyomi/core/common/storage/AndroidStorageFolderProvider.kt @@ -1,9 +1,9 @@ -package tachiyomi.core.storage +package tachiyomi.core.common.storage import android.content.Context import android.os.Environment import androidx.core.net.toUri -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR import java.io.File diff --git a/core/src/main/java/tachiyomi/core/storage/FolderProvider.kt b/core/common/src/main/java/tachiyomi/core/common/storage/FolderProvider.kt similarity index 72% rename from core/src/main/java/tachiyomi/core/storage/FolderProvider.kt rename to core/common/src/main/java/tachiyomi/core/common/storage/FolderProvider.kt index decd1c378..06d3e364f 100644 --- a/core/src/main/java/tachiyomi/core/storage/FolderProvider.kt +++ b/core/common/src/main/java/tachiyomi/core/common/storage/FolderProvider.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.storage +package tachiyomi.core.common.storage import java.io.File diff --git a/core/common/src/main/java/tachiyomi/core/common/storage/UniFileExtensions.kt b/core/common/src/main/java/tachiyomi/core/common/storage/UniFileExtensions.kt new file mode 100644 index 000000000..257fe210d --- /dev/null +++ b/core/common/src/main/java/tachiyomi/core/common/storage/UniFileExtensions.kt @@ -0,0 +1,19 @@ +package tachiyomi.core.common.storage + +import android.content.Context +import android.os.ParcelFileDescriptor +import com.hippo.unifile.UniFile +import java.nio.channels.FileChannel + +val UniFile.extension: String? + get() = name?.substringAfterLast('.') + +val UniFile.nameWithoutExtension: String? + get() = name?.substringBeforeLast('.') + +val UniFile.displayablePath: String + get() = filePath ?: uri.toString() + +fun UniFile.openReadOnlyChannel(context: Context): FileChannel { + return ParcelFileDescriptor.AutoCloseInputStream(context.contentResolver.openFileDescriptor(uri, "r")).channel +} diff --git a/core/src/main/java/tachiyomi/core/storage/UniFileTempFileManager.kt b/core/common/src/main/java/tachiyomi/core/common/storage/UniFileTempFileManager.kt similarity index 97% rename from core/src/main/java/tachiyomi/core/storage/UniFileTempFileManager.kt rename to core/common/src/main/java/tachiyomi/core/common/storage/UniFileTempFileManager.kt index 0aa9f4b85..4ccc5bf43 100644 --- a/core/src/main/java/tachiyomi/core/storage/UniFileTempFileManager.kt +++ b/core/common/src/main/java/tachiyomi/core/common/storage/UniFileTempFileManager.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.storage +package tachiyomi.core.common.storage import android.content.Context import android.os.Build diff --git a/core/src/main/java/tachiyomi/core/util/lang/BooleanExtensions.kt b/core/common/src/main/java/tachiyomi/core/common/util/lang/BooleanExtensions.kt similarity index 52% rename from core/src/main/java/tachiyomi/core/util/lang/BooleanExtensions.kt rename to core/common/src/main/java/tachiyomi/core/common/util/lang/BooleanExtensions.kt index 853499550..ca59ea7a7 100644 --- a/core/src/main/java/tachiyomi/core/util/lang/BooleanExtensions.kt +++ b/core/common/src/main/java/tachiyomi/core/common/util/lang/BooleanExtensions.kt @@ -1,3 +1,3 @@ -package tachiyomi.core.util.lang +package tachiyomi.core.common.util.lang fun Boolean.toLong() = if (this) 1L else 0L diff --git a/core/src/main/java/tachiyomi/core/util/lang/CoroutinesExtensions.kt b/core/common/src/main/java/tachiyomi/core/common/util/lang/CoroutinesExtensions.kt similarity index 98% rename from core/src/main/java/tachiyomi/core/util/lang/CoroutinesExtensions.kt rename to core/common/src/main/java/tachiyomi/core/common/util/lang/CoroutinesExtensions.kt index 829207a9b..a76bff2cc 100644 --- a/core/src/main/java/tachiyomi/core/util/lang/CoroutinesExtensions.kt +++ b/core/common/src/main/java/tachiyomi/core/common/util/lang/CoroutinesExtensions.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.util.lang +package tachiyomi.core.common.util.lang import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart diff --git a/core/src/main/java/tachiyomi/core/util/lang/RxCoroutineBridge.kt b/core/common/src/main/java/tachiyomi/core/common/util/lang/RxCoroutineBridge.kt similarity index 98% rename from core/src/main/java/tachiyomi/core/util/lang/RxCoroutineBridge.kt rename to core/common/src/main/java/tachiyomi/core/common/util/lang/RxCoroutineBridge.kt index 56f58e1d4..d6f521cc0 100644 --- a/core/src/main/java/tachiyomi/core/util/lang/RxCoroutineBridge.kt +++ b/core/common/src/main/java/tachiyomi/core/common/util/lang/RxCoroutineBridge.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.util.lang +package tachiyomi.core.common.util.lang import kotlinx.coroutines.CancellableContinuation import kotlinx.coroutines.InternalCoroutinesApi diff --git a/core/src/main/java/tachiyomi/core/util/lang/SortUtil.kt b/core/common/src/main/java/tachiyomi/core/common/util/lang/SortUtil.kt similarity index 88% rename from core/src/main/java/tachiyomi/core/util/lang/SortUtil.kt rename to core/common/src/main/java/tachiyomi/core/common/util/lang/SortUtil.kt index 03c15d43b..9efe5f79f 100644 --- a/core/src/main/java/tachiyomi/core/util/lang/SortUtil.kt +++ b/core/common/src/main/java/tachiyomi/core/common/util/lang/SortUtil.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.util.lang +package tachiyomi.core.common.util.lang import java.text.Collator import java.util.Locale diff --git a/core/src/main/java/tachiyomi/core/util/system/ImageUtil.kt b/core/common/src/main/java/tachiyomi/core/common/util/system/ImageUtil.kt similarity index 99% rename from core/src/main/java/tachiyomi/core/util/system/ImageUtil.kt rename to core/common/src/main/java/tachiyomi/core/common/util/system/ImageUtil.kt index 9bc0567ef..05af9f0aa 100644 --- a/core/src/main/java/tachiyomi/core/util/system/ImageUtil.kt +++ b/core/common/src/main/java/tachiyomi/core/common/util/system/ImageUtil.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.util.system +package tachiyomi.core.common.util.system import android.content.Context import android.content.res.Configuration diff --git a/core/src/main/java/tachiyomi/core/util/system/LogcatExtensions.kt b/core/common/src/main/java/tachiyomi/core/common/util/system/LogcatExtensions.kt similarity index 90% rename from core/src/main/java/tachiyomi/core/util/system/LogcatExtensions.kt rename to core/common/src/main/java/tachiyomi/core/common/util/system/LogcatExtensions.kt index fb587b07d..115f647f5 100644 --- a/core/src/main/java/tachiyomi/core/util/system/LogcatExtensions.kt +++ b/core/common/src/main/java/tachiyomi/core/common/util/system/LogcatExtensions.kt @@ -1,4 +1,4 @@ -package tachiyomi.core.util.system +package tachiyomi.core.common.util.system import logcat.LogPriority import logcat.asLog diff --git a/core/src/main/java/tachiyomi/core/storage/UniFileExtensions.kt b/core/src/main/java/tachiyomi/core/storage/UniFileExtensions.kt deleted file mode 100644 index afe60ed35..000000000 --- a/core/src/main/java/tachiyomi/core/storage/UniFileExtensions.kt +++ /dev/null @@ -1,12 +0,0 @@ -package tachiyomi.core.storage - -import com.hippo.unifile.UniFile - -val UniFile.extension: String? - get() = name?.substringAfterLast('.') - -val UniFile.nameWithoutExtension: String? - get() = name?.substringBeforeLast('.') - -val UniFile.displayablePath: String - get() = filePath ?: uri.toString() diff --git a/data/build.gradle.kts b/data/build.gradle.kts index 4229d6060..4edccb4cc 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -35,7 +35,7 @@ android { dependencies { implementation(projects.sourceApi) implementation(projects.domain) - implementation(projects.core) + implementation(projects.core.common) api(libs.bundles.sqldelight) } diff --git a/data/src/main/java/tachiyomi/data/entries/anime/AnimeRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/entries/anime/AnimeRepositoryImpl.kt index b2b41e21e..aa3b1872d 100644 --- a/data/src/main/java/tachiyomi/data/entries/anime/AnimeRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/entries/anime/AnimeRepositoryImpl.kt @@ -2,7 +2,7 @@ package tachiyomi.data.entries.anime import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.data.AnimeUpdateStrategyColumnAdapter import tachiyomi.data.StringListColumnAdapter import tachiyomi.data.handlers.anime.AnimeDatabaseHandler diff --git a/data/src/main/java/tachiyomi/data/entries/manga/MangaRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/entries/manga/MangaRepositoryImpl.kt index f09a386c4..88d4d79f8 100644 --- a/data/src/main/java/tachiyomi/data/entries/manga/MangaRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/entries/manga/MangaRepositoryImpl.kt @@ -2,7 +2,7 @@ package tachiyomi.data.entries.manga import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.data.MangaUpdateStrategyColumnAdapter import tachiyomi.data.StringListColumnAdapter import tachiyomi.data.handlers.manga.MangaDatabaseHandler diff --git a/data/src/main/java/tachiyomi/data/history/anime/AnimeHistoryRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/history/anime/AnimeHistoryRepositoryImpl.kt index f66002f89..2fed76976 100644 --- a/data/src/main/java/tachiyomi/data/history/anime/AnimeHistoryRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/history/anime/AnimeHistoryRepositoryImpl.kt @@ -2,7 +2,7 @@ package tachiyomi.data.history.anime import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.data.handlers.anime.AnimeDatabaseHandler import tachiyomi.domain.history.anime.model.AnimeHistory import tachiyomi.domain.history.anime.model.AnimeHistoryUpdate diff --git a/data/src/main/java/tachiyomi/data/history/manga/MangaHistoryRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/history/manga/MangaHistoryRepositoryImpl.kt index 0c762d6ab..bd1cf0990 100644 --- a/data/src/main/java/tachiyomi/data/history/manga/MangaHistoryRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/history/manga/MangaHistoryRepositoryImpl.kt @@ -2,7 +2,7 @@ package tachiyomi.data.history.manga import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.data.handlers.manga.MangaDatabaseHandler import tachiyomi.domain.history.manga.model.MangaHistory import tachiyomi.domain.history.manga.model.MangaHistoryUpdate diff --git a/data/src/main/java/tachiyomi/data/items/chapter/ChapterRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/items/chapter/ChapterRepositoryImpl.kt index c4c4d8372..b81a939a8 100644 --- a/data/src/main/java/tachiyomi/data/items/chapter/ChapterRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/items/chapter/ChapterRepositoryImpl.kt @@ -2,8 +2,8 @@ package tachiyomi.data.items.chapter import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.lang.toLong -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.toLong +import tachiyomi.core.common.util.system.logcat import tachiyomi.data.handlers.manga.MangaDatabaseHandler import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.domain.items.chapter.model.ChapterUpdate diff --git a/data/src/main/java/tachiyomi/data/items/episode/EpisodeRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/items/episode/EpisodeRepositoryImpl.kt index 47ab35af4..2d247a961 100644 --- a/data/src/main/java/tachiyomi/data/items/episode/EpisodeRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/items/episode/EpisodeRepositoryImpl.kt @@ -2,7 +2,7 @@ package tachiyomi.data.items.episode import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.data.handlers.anime.AnimeDatabaseHandler import tachiyomi.domain.items.episode.model.Episode import tachiyomi.domain.items.episode.model.EpisodeUpdate diff --git a/data/src/main/java/tachiyomi/data/source/anime/AnimeSourcePagingSource.kt b/data/src/main/java/tachiyomi/data/source/anime/AnimeSourcePagingSource.kt index e43051150..608ced004 100644 --- a/data/src/main/java/tachiyomi/data/source/anime/AnimeSourcePagingSource.kt +++ b/data/src/main/java/tachiyomi/data/source/anime/AnimeSourcePagingSource.kt @@ -5,7 +5,7 @@ import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource import eu.kanade.tachiyomi.animesource.model.AnimeFilterList import eu.kanade.tachiyomi.animesource.model.AnimesPage import eu.kanade.tachiyomi.animesource.model.SAnime -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.items.episode.model.NoEpisodesException import tachiyomi.domain.source.anime.repository.AnimeSourcePagingSourceType diff --git a/data/src/main/java/tachiyomi/data/source/manga/MangaSourcePagingSource.kt b/data/src/main/java/tachiyomi/data/source/manga/MangaSourcePagingSource.kt index a6ce01b15..5050dd9be 100644 --- a/data/src/main/java/tachiyomi/data/source/manga/MangaSourcePagingSource.kt +++ b/data/src/main/java/tachiyomi/data/source/manga/MangaSourcePagingSource.kt @@ -5,7 +5,7 @@ import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.SManga -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.items.chapter.model.NoChaptersException import tachiyomi.domain.source.manga.repository.SourcePagingSourceType diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index 949de1f8e..dc8c33315 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -15,7 +15,7 @@ android { dependencies { implementation(projects.sourceApi) - implementation(projects.core) + implementation(projects.core.common) implementation(platform(kotlinx.coroutines.bom)) implementation(kotlinx.bundles.coroutines) diff --git a/domain/src/main/java/tachiyomi/domain/backup/service/BackupPreferences.kt b/domain/src/main/java/tachiyomi/domain/backup/service/BackupPreferences.kt index 1f1463839..e7080a580 100644 --- a/domain/src/main/java/tachiyomi/domain/backup/service/BackupPreferences.kt +++ b/domain/src/main/java/tachiyomi/domain/backup/service/BackupPreferences.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.backup.service -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore class BackupPreferences( private val preferenceStore: PreferenceStore, diff --git a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/CreateAnimeCategoryWithName.kt b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/CreateAnimeCategoryWithName.kt index cfbd7a327..f02f8220f 100644 --- a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/CreateAnimeCategoryWithName.kt +++ b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/CreateAnimeCategoryWithName.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.anime.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.repository.AnimeCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.service.LibraryPreferences diff --git a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/DeleteAnimeCategory.kt b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/DeleteAnimeCategory.kt index 2b6882377..078b9225a 100644 --- a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/DeleteAnimeCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/DeleteAnimeCategory.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.anime.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.repository.AnimeCategoryRepository import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/HideAnimeCategory.kt b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/HideAnimeCategory.kt index 667ab0e45..0fe6c1308 100644 --- a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/HideAnimeCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/HideAnimeCategory.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.anime.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.repository.AnimeCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/RenameAnimeCategory.kt b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/RenameAnimeCategory.kt index 6939cfa57..bec422eff 100644 --- a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/RenameAnimeCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/RenameAnimeCategory.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.anime.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.repository.AnimeCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/ReorderAnimeCategory.kt b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/ReorderAnimeCategory.kt index 1fa655188..420a5c41f 100644 --- a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/ReorderAnimeCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/ReorderAnimeCategory.kt @@ -3,8 +3,8 @@ package tachiyomi.domain.category.anime.interactor import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.anime.repository.AnimeCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/SetAnimeCategories.kt b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/SetAnimeCategories.kt index 0f72e907c..1ad9d48eb 100644 --- a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/SetAnimeCategories.kt +++ b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/SetAnimeCategories.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.category.anime.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.repository.AnimeRepository class SetAnimeCategories( diff --git a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/UpdateAnimeCategory.kt b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/UpdateAnimeCategory.kt index 84fa22784..6e487a591 100644 --- a/domain/src/main/java/tachiyomi/domain/category/anime/interactor/UpdateAnimeCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/anime/interactor/UpdateAnimeCategory.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.category.anime.interactor -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.domain.category.anime.repository.AnimeCategoryRepository import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/CreateMangaCategoryWithName.kt b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/CreateMangaCategoryWithName.kt index b9ce4278a..d4bc83926 100644 --- a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/CreateMangaCategoryWithName.kt +++ b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/CreateMangaCategoryWithName.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.manga.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.repository.MangaCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.service.LibraryPreferences diff --git a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/DeleteMangaCategory.kt b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/DeleteMangaCategory.kt index 53da0847b..f3220ce7a 100644 --- a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/DeleteMangaCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/DeleteMangaCategory.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.manga.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.repository.MangaCategoryRepository import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/HideMangaCategory.kt b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/HideMangaCategory.kt index 36c9d3fb3..7824e2f54 100644 --- a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/HideMangaCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/HideMangaCategory.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.manga.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.repository.MangaCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/RenameMangaCategory.kt b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/RenameMangaCategory.kt index ec135f53a..c7d6d92c2 100644 --- a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/RenameMangaCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/RenameMangaCategory.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.category.manga.interactor import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.repository.MangaCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/ReorderMangaCategory.kt b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/ReorderMangaCategory.kt index 079d92c1f..450145a39 100644 --- a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/ReorderMangaCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/ReorderMangaCategory.kt @@ -3,8 +3,8 @@ package tachiyomi.domain.category.manga.interactor import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import logcat.LogPriority -import tachiyomi.core.util.lang.withNonCancellableContext -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.category.manga.repository.MangaCategoryRepository import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/SetMangaCategories.kt b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/SetMangaCategories.kt index cd7754f39..48b64b36f 100644 --- a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/SetMangaCategories.kt +++ b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/SetMangaCategories.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.category.manga.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.repository.MangaRepository class SetMangaCategories( diff --git a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/UpdateMangaCategory.kt b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/UpdateMangaCategory.kt index 305403a14..e59aa866e 100644 --- a/domain/src/main/java/tachiyomi/domain/category/manga/interactor/UpdateMangaCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/manga/interactor/UpdateMangaCategory.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.category.manga.interactor -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.domain.category.manga.repository.MangaCategoryRepository import tachiyomi.domain.category.model.CategoryUpdate diff --git a/domain/src/main/java/tachiyomi/domain/download/service/DownloadPreferences.kt b/domain/src/main/java/tachiyomi/domain/download/service/DownloadPreferences.kt index c1a9c0ec4..f235e55e5 100644 --- a/domain/src/main/java/tachiyomi/domain/download/service/DownloadPreferences.kt +++ b/domain/src/main/java/tachiyomi/domain/download/service/DownloadPreferences.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.download.service -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.PreferenceStore class DownloadPreferences( private val preferenceStore: PreferenceStore, diff --git a/domain/src/main/java/tachiyomi/domain/entries/TriState.kt b/domain/src/main/java/tachiyomi/domain/entries/TriState.kt index 2e833c062..afa2e0703 100644 --- a/domain/src/main/java/tachiyomi/domain/entries/TriState.kt +++ b/domain/src/main/java/tachiyomi/domain/entries/TriState.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.entries -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState inline fun applyFilter(filter: TriState, predicate: () -> Boolean): Boolean = when (filter) { TriState.DISABLED -> true diff --git a/domain/src/main/java/tachiyomi/domain/entries/anime/interactor/GetAnime.kt b/domain/src/main/java/tachiyomi/domain/entries/anime/interactor/GetAnime.kt index 995207af5..b6ae6311a 100644 --- a/domain/src/main/java/tachiyomi/domain/entries/anime/interactor/GetAnime.kt +++ b/domain/src/main/java/tachiyomi/domain/entries/anime/interactor/GetAnime.kt @@ -2,7 +2,7 @@ package tachiyomi.domain.entries.anime.interactor import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.entries.anime.repository.AnimeRepository diff --git a/domain/src/main/java/tachiyomi/domain/entries/anime/model/Anime.kt b/domain/src/main/java/tachiyomi/domain/entries/anime/model/Anime.kt index 9e8d3348a..772d73ba7 100644 --- a/domain/src/main/java/tachiyomi/domain/entries/anime/model/Anime.kt +++ b/domain/src/main/java/tachiyomi/domain/entries/anime/model/Anime.kt @@ -2,7 +2,7 @@ package tachiyomi.domain.entries.anime.model import eu.kanade.tachiyomi.animesource.model.AnimeUpdateStrategy import eu.kanade.tachiyomi.animesource.model.SAnime -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import java.io.Serializable import java.time.Instant import kotlin.math.pow diff --git a/domain/src/main/java/tachiyomi/domain/entries/manga/interactor/GetManga.kt b/domain/src/main/java/tachiyomi/domain/entries/manga/interactor/GetManga.kt index e1a7e5e58..a659238dd 100644 --- a/domain/src/main/java/tachiyomi/domain/entries/manga/interactor/GetManga.kt +++ b/domain/src/main/java/tachiyomi/domain/entries/manga/interactor/GetManga.kt @@ -2,7 +2,7 @@ package tachiyomi.domain.entries.manga.interactor import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.entries.manga.repository.MangaRepository diff --git a/domain/src/main/java/tachiyomi/domain/entries/manga/model/Manga.kt b/domain/src/main/java/tachiyomi/domain/entries/manga/model/Manga.kt index 5bbf386ed..ed479a5aa 100644 --- a/domain/src/main/java/tachiyomi/domain/entries/manga/model/Manga.kt +++ b/domain/src/main/java/tachiyomi/domain/entries/manga/model/Manga.kt @@ -2,7 +2,7 @@ package tachiyomi.domain.entries.manga.model import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.UpdateStrategy -import tachiyomi.core.preference.TriState +import tachiyomi.core.common.preference.TriState import java.io.Serializable import java.time.Instant diff --git a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChapter.kt b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChapter.kt index c3269ac3d..6e4af0ca1 100644 --- a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChapter.kt +++ b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChapter.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.items.chapter.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.domain.items.chapter.repository.ChapterRepository diff --git a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChaptersByMangaId.kt b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChaptersByMangaId.kt index 89ffb1690..ada2f096c 100644 --- a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChaptersByMangaId.kt +++ b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/GetChaptersByMangaId.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.items.chapter.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.chapter.model.Chapter import tachiyomi.domain.items.chapter.repository.ChapterRepository diff --git a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/SetMangaDefaultChapterFlags.kt b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/SetMangaDefaultChapterFlags.kt index d27ecedba..e433516aa 100644 --- a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/SetMangaDefaultChapterFlags.kt +++ b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/SetMangaDefaultChapterFlags.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.items.chapter.interactor -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.domain.entries.manga.interactor.GetMangaFavorites import tachiyomi.domain.entries.manga.interactor.SetMangaChapterFlags import tachiyomi.domain.entries.manga.model.Manga diff --git a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/UpdateChapter.kt b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/UpdateChapter.kt index ec4cb6a2f..a2209a942 100644 --- a/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/UpdateChapter.kt +++ b/domain/src/main/java/tachiyomi/domain/items/chapter/interactor/UpdateChapter.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.items.chapter.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.chapter.model.ChapterUpdate import tachiyomi.domain.items.chapter.repository.ChapterRepository diff --git a/domain/src/main/java/tachiyomi/domain/items/chapter/service/ChapterSorter.kt b/domain/src/main/java/tachiyomi/domain/items/chapter/service/ChapterSorter.kt index f0d68061f..27189f909 100644 --- a/domain/src/main/java/tachiyomi/domain/items/chapter/service/ChapterSorter.kt +++ b/domain/src/main/java/tachiyomi/domain/items/chapter/service/ChapterSorter.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.items.chapter.service -import tachiyomi.core.util.lang.compareToWithCollator +import tachiyomi.core.common.util.lang.compareToWithCollator import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.model.Chapter diff --git a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisode.kt b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisode.kt index 911242ead..ee6bfeff4 100644 --- a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisode.kt +++ b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisode.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.items.episode.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.episode.model.Episode import tachiyomi.domain.items.episode.repository.EpisodeRepository diff --git a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisodesByAnimeId.kt b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisodesByAnimeId.kt index 555480c88..289b92aaa 100644 --- a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisodesByAnimeId.kt +++ b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/GetEpisodesByAnimeId.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.items.episode.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.episode.model.Episode import tachiyomi.domain.items.episode.repository.EpisodeRepository diff --git a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/SetAnimeDefaultEpisodeFlags.kt b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/SetAnimeDefaultEpisodeFlags.kt index 3ea783d2c..f9157d47a 100644 --- a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/SetAnimeDefaultEpisodeFlags.kt +++ b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/SetAnimeDefaultEpisodeFlags.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.items.episode.interactor -import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.common.util.lang.withNonCancellableContext import tachiyomi.domain.entries.anime.interactor.GetAnimeFavorites import tachiyomi.domain.entries.anime.interactor.SetAnimeEpisodeFlags import tachiyomi.domain.entries.anime.model.Anime diff --git a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/UpdateEpisode.kt b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/UpdateEpisode.kt index 9382798e2..ab677d837 100644 --- a/domain/src/main/java/tachiyomi/domain/items/episode/interactor/UpdateEpisode.kt +++ b/domain/src/main/java/tachiyomi/domain/items/episode/interactor/UpdateEpisode.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.items.episode.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.items.episode.model.EpisodeUpdate import tachiyomi.domain.items.episode.repository.EpisodeRepository diff --git a/domain/src/main/java/tachiyomi/domain/items/episode/service/EpisodeSorter.kt b/domain/src/main/java/tachiyomi/domain/items/episode/service/EpisodeSorter.kt index 0e4e60c3b..ca983f8de 100644 --- a/domain/src/main/java/tachiyomi/domain/items/episode/service/EpisodeSorter.kt +++ b/domain/src/main/java/tachiyomi/domain/items/episode/service/EpisodeSorter.kt @@ -1,6 +1,6 @@ package tachiyomi.domain.items.episode.service -import tachiyomi.core.util.lang.compareToWithCollator +import tachiyomi.core.common.util.lang.compareToWithCollator import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.model.Episode diff --git a/domain/src/main/java/tachiyomi/domain/library/service/LibraryPreferences.kt b/domain/src/main/java/tachiyomi/domain/library/service/LibraryPreferences.kt index e372d4661..cce3b4fe7 100644 --- a/domain/src/main/java/tachiyomi/domain/library/service/LibraryPreferences.kt +++ b/domain/src/main/java/tachiyomi/domain/library/service/LibraryPreferences.kt @@ -1,9 +1,9 @@ package tachiyomi.domain.library.service -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.preference.TriState -import tachiyomi.core.preference.getEnum +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.preference.getEnum import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.library.anime.model.AnimeLibrarySort diff --git a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt index 9c61bf895..c0e430bb5 100644 --- a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt +++ b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.release.interactor -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore import tachiyomi.domain.release.model.Release import tachiyomi.domain.release.service.ReleaseService import java.time.Instant diff --git a/domain/src/main/java/tachiyomi/domain/storage/service/StoragePreferences.kt b/domain/src/main/java/tachiyomi/domain/storage/service/StoragePreferences.kt index a49a54e3c..f29949cff 100644 --- a/domain/src/main/java/tachiyomi/domain/storage/service/StoragePreferences.kt +++ b/domain/src/main/java/tachiyomi/domain/storage/service/StoragePreferences.kt @@ -1,8 +1,8 @@ package tachiyomi.domain.storage.service -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore -import tachiyomi.core.storage.FolderProvider +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore +import tachiyomi.core.common.storage.FolderProvider class StoragePreferences( private val folderProvider: FolderProvider, diff --git a/domain/src/main/java/tachiyomi/domain/track/anime/interactor/DeleteAnimeTrack.kt b/domain/src/main/java/tachiyomi/domain/track/anime/interactor/DeleteAnimeTrack.kt index 4e109a46e..95821f129 100644 --- a/domain/src/main/java/tachiyomi/domain/track/anime/interactor/DeleteAnimeTrack.kt +++ b/domain/src/main/java/tachiyomi/domain/track/anime/interactor/DeleteAnimeTrack.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.track.anime.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.anime.repository.AnimeTrackRepository class DeleteAnimeTrack( diff --git a/domain/src/main/java/tachiyomi/domain/track/anime/interactor/GetAnimeTracks.kt b/domain/src/main/java/tachiyomi/domain/track/anime/interactor/GetAnimeTracks.kt index 38c60e132..ddc5a160b 100644 --- a/domain/src/main/java/tachiyomi/domain/track/anime/interactor/GetAnimeTracks.kt +++ b/domain/src/main/java/tachiyomi/domain/track/anime/interactor/GetAnimeTracks.kt @@ -2,7 +2,7 @@ package tachiyomi.domain.track.anime.interactor import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.anime.model.AnimeTrack import tachiyomi.domain.track.anime.repository.AnimeTrackRepository diff --git a/domain/src/main/java/tachiyomi/domain/track/anime/interactor/InsertAnimeTrack.kt b/domain/src/main/java/tachiyomi/domain/track/anime/interactor/InsertAnimeTrack.kt index dcb801cd5..72fbd397a 100644 --- a/domain/src/main/java/tachiyomi/domain/track/anime/interactor/InsertAnimeTrack.kt +++ b/domain/src/main/java/tachiyomi/domain/track/anime/interactor/InsertAnimeTrack.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.track.anime.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.anime.model.AnimeTrack import tachiyomi.domain.track.anime.repository.AnimeTrackRepository diff --git a/domain/src/main/java/tachiyomi/domain/track/manga/interactor/DeleteMangaTrack.kt b/domain/src/main/java/tachiyomi/domain/track/manga/interactor/DeleteMangaTrack.kt index f1979546e..6cd275926 100644 --- a/domain/src/main/java/tachiyomi/domain/track/manga/interactor/DeleteMangaTrack.kt +++ b/domain/src/main/java/tachiyomi/domain/track/manga/interactor/DeleteMangaTrack.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.track.manga.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.manga.repository.MangaTrackRepository class DeleteMangaTrack( diff --git a/domain/src/main/java/tachiyomi/domain/track/manga/interactor/GetMangaTracks.kt b/domain/src/main/java/tachiyomi/domain/track/manga/interactor/GetMangaTracks.kt index 19055dab9..c8fe489b4 100644 --- a/domain/src/main/java/tachiyomi/domain/track/manga/interactor/GetMangaTracks.kt +++ b/domain/src/main/java/tachiyomi/domain/track/manga/interactor/GetMangaTracks.kt @@ -2,7 +2,7 @@ package tachiyomi.domain.track.manga.interactor import kotlinx.coroutines.flow.Flow import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.manga.model.MangaTrack import tachiyomi.domain.track.manga.repository.MangaTrackRepository diff --git a/domain/src/main/java/tachiyomi/domain/track/manga/interactor/InsertMangaTrack.kt b/domain/src/main/java/tachiyomi/domain/track/manga/interactor/InsertMangaTrack.kt index 566d8c886..95972a84b 100644 --- a/domain/src/main/java/tachiyomi/domain/track/manga/interactor/InsertMangaTrack.kt +++ b/domain/src/main/java/tachiyomi/domain/track/manga/interactor/InsertMangaTrack.kt @@ -1,7 +1,7 @@ package tachiyomi.domain.track.manga.interactor import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.track.manga.model.MangaTrack import tachiyomi.domain.track.manga.repository.MangaTrackRepository diff --git a/domain/src/test/java/tachiyomi/domain/release/interactor/GetApplicationReleaseTest.kt b/domain/src/test/java/tachiyomi/domain/release/interactor/GetApplicationReleaseTest.kt index f813094fe..fe564050a 100644 --- a/domain/src/test/java/tachiyomi/domain/release/interactor/GetApplicationReleaseTest.kt +++ b/domain/src/test/java/tachiyomi/domain/release/interactor/GetApplicationReleaseTest.kt @@ -8,8 +8,8 @@ import io.mockk.mockk import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.PreferenceStore import tachiyomi.domain.release.model.Release import tachiyomi.domain.release.service.ReleaseService import java.time.Instant diff --git a/gradle.properties b/gradle.properties index 8068b0dcc..22e7dfed5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,26 +1,10 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx1024m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -org.gradle.jvmargs=-Xmx5120m - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -org.gradle.parallel=true - -org.gradle.caching=true +android.nonTransitiveRClass=false +android.useAndroidX=true +kotlin.code.style=official kotlin.mpp.androidSourceSetLayoutVersion=2 -android.useAndroidX=true -android.nonTransitiveRClass=false \ No newline at end of file +org.gradle.caching=true +org.gradle.configureondemand=true +org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8 +org.gradle.parallel=true diff --git a/gradle/androidx.versions.toml b/gradle/androidx.versions.toml index abf80fa96..81d0fffcc 100644 --- a/gradle/androidx.versions.toml +++ b/gradle/androidx.versions.toml @@ -1,6 +1,6 @@ [versions] -agp_version = "8.2.1" -lifecycle_version = "2.6.2" +agp_version = "8.2.2" +lifecycle_version = "2.7.0" paging_version = "3.2.1" [libraries] @@ -26,9 +26,9 @@ workmanager = "androidx.work:work-runtime:2.9.0" paging-runtime = { module = "androidx.paging:paging-runtime", version.ref = "paging_version" } paging-compose = { module = "androidx.paging:paging-compose", version.ref = "paging_version" } -benchmark-macro = "androidx.benchmark:benchmark-macro-junit4:1.2.2" -test-ext = "androidx.test.ext:junit-ktx:1.2.0-alpha02" -test-espresso-core = "androidx.test.espresso:espresso-core:3.6.0-alpha02" +benchmark-macro = "androidx.benchmark:benchmark-macro-junit4:1.2.3" +test-ext = "androidx.test.ext:junit-ktx:1.2.0-alpha03" +test-espresso-core = "androidx.test.espresso:espresso-core:3.6.0-alpha03" test-uiautomator = "androidx.test.uiautomator:uiautomator:2.3.0-beta01" [bundles] diff --git a/gradle/compose.versions.toml b/gradle/compose.versions.toml index 3fa4daa3f..1d6d60586 100644 --- a/gradle/compose.versions.toml +++ b/gradle/compose.versions.toml @@ -1,7 +1,7 @@ [versions] compiler = "1.5.8" -compose-bom = "2023.12.00-alpha04" -accompanist = "0.33.2-alpha" +compose-bom = "2024.01.00-alpha03" +accompanist = "0.34.0" [libraries] activity = "androidx.activity:activity-compose:1.8.2" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 10180f2b7..71ca30219 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp_ve okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp_version" } okhttp-brotli = { module = "com.squareup.okhttp3:okhttp-brotli", version.ref = "okhttp_version" } okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp_version" } -okio = "com.squareup.okio:okio:3.7.0" +okio = "com.squareup.okio:okio:3.8.0" conscrypt-android = "org.conscrypt:conscrypt-android:2.5.2" @@ -30,11 +30,12 @@ jsoup = "org.jsoup:jsoup:1.17.2" disklrucache = "com.jakewharton:disklrucache:2.0.2" unifile = "com.github.tachiyomiorg:unifile:7c257e1c64" +common-compress = "org.apache.commons:commons-compress:1.26.0" junrar = "com.github.junrar:junrar:7.5.5" sqlite-framework = { module = "androidx.sqlite:sqlite-framework", version.ref = "sqlite" } sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" } -sqlite-android = "com.github.requery:sqlite-android:3.43.0" +sqlite-android = "com.github.requery:sqlite-android:3.45.0" preferencektx = "androidx.preference:preference-ktx:1.2.1" @@ -58,7 +59,7 @@ flexible-adapter-core = "com.github.arkon.FlexibleAdapter:flexible-adapter:c8013 photoview = "com.github.chrisbanes:PhotoView:2.3.0" directionalviewpager = "com.github.tachiyomiorg:DirectionalViewPager:1.0.0" insetter = "dev.chrisbanes.insetter:insetter:0.6.1" -compose-materialmotion = "io.github.fornewid:material-motion-compose-core:1.1.0" +compose-materialmotion = "io.github.fornewid:material-motion-compose-core:1.2.0" swipe = "me.saket.swipe:swipe:1.2.0" @@ -106,6 +107,7 @@ seeker = "io.github.2307vivek:seeker:1.1.1" truetypeparser = "io.github.yubyf:truetypeparser-light:2.1.4" [bundles] +archive = ["common-compress", "junrar"] acra = ["acra-http", "acra-scheduler"] okhttp = ["okhttp-core", "okhttp-logging", "okhttp-brotli", "okhttp-dnsoverhttps"] js-engine = ["quickjs-android"] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e0930..a80b22ce5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/i18n/build.gradle.kts b/i18n/build.gradle.kts index 366e19ad3..075a39b3d 100644 --- a/i18n/build.gradle.kts +++ b/i18n/build.gradle.kts @@ -6,13 +6,17 @@ plugins { kotlin { androidTarget() + + applyDefaultHierarchyTemplate() + sourceSets { val commonMain by getting { dependencies { api(libs.moko.core) } } - val androidMain by getting { + + androidMain { dependsOn(commonMain) // https://github.com/icerockdev/moko-resources/issues/562 } } diff --git a/i18n/src/commonMain/resources/MR/base/plurals.xml b/i18n/src/commonMain/resources/MR/base/plurals.xml index a4be2ea83..501e4140d 100644 --- a/i18n/src/commonMain/resources/MR/base/plurals.xml +++ b/i18n/src/commonMain/resources/MR/base/plurals.xml @@ -8,6 +8,10 @@ Yesterday %1$d days ago + + Tomorrow + In %1$d days + %d category %d categories diff --git a/i18n/src/commonMain/resources/MR/base/strings.xml b/i18n/src/commonMain/resources/MR/base/strings.xml index a4e1400d0..65d7ca309 100644 --- a/i18n/src/commonMain/resources/MR/base/strings.xml +++ b/i18n/src/commonMain/resources/MR/base/strings.xml @@ -416,6 +416,7 @@ High Low Lowest + Disable zoom out Excluded categories No storage location set Invalid location: %s diff --git a/i18n/src/commonMain/resources/MR/cv/plurals.xml b/i18n/src/commonMain/resources/MR/cv/plurals.xml index 1d72363a6..fb5330ade 100644 --- a/i18n/src/commonMain/resources/MR/cv/plurals.xml +++ b/i18n/src/commonMain/resources/MR/cv/plurals.xml @@ -5,28 +5,28 @@ %d пухмӑш - 1 минут хыҫҫӑн + %1$s минут хыҫҫӑн %1$s минут хыҫҫӑн - %1$s,%2$s йӑнӑшпа тӑвӑннӑ - %1$s, %2$s йӑнӑшпа тӑвӑннӑ + %1$s хушши %2$s йӑнӑшпа тӑвӑннӑ + %1$s хушши %2$s йӑнӑшпа тӑвӑннӑ Хушма валли ҫӗнетӳ пур %d хушма валли ҫӗнетӳ пур - %1$s сыпӑкӗсем - %1$s сыпӑкӗсем тата ытти %2$d + %1$s сыпӑкӗсем тата тепӗр 1 + %1$s сыпӑкӗсем тата тепӗр %2$d - 1 ҫӗнӗ сыпӑк + %1$d ҫӗнӗ сыпӑк %1$d ҫӗнӗ сыпӑк - Ҫӗнӗ сыпӑксем 1 хайлав валли тупӑннӑ - Ҫӗнӗ сыпӑксем %d хайлав валли тупӑннӑ + %d хайлав валли + %d хайлав валли 1 сыпӑк @@ -37,11 +37,11 @@ %1$s юлчӗ - 1 сӑнану - %d сӑнану + %d йӗрлев + %d йӗрлев - 1 сыпӑк ҫук + %d сыпӑк ҫук %d сыпӑк ҫук @@ -76,4 +76,8 @@ + + %d усрав + %d усрав + \ No newline at end of file diff --git a/i18n/src/commonMain/resources/MR/eo/plurals.xml b/i18n/src/commonMain/resources/MR/eo/plurals.xml index e5d077a71..f49f4ea15 100644 --- a/i18n/src/commonMain/resources/MR/eo/plurals.xml +++ b/i18n/src/commonMain/resources/MR/eo/plurals.xml @@ -1,7 +1,7 @@ - Post 1 minuto + Post %1$s minuto Post %1$s minutoj @@ -17,7 +17,7 @@ Ĉapitroj %1$s kaj %2$d pli - 1 nova ĉapitro + %1$d nova ĉapitro %1$d novaj ĉapitroj @@ -25,8 +25,8 @@ Por %d titoloj - Mankas 1 ĉapitron - Mankas %d ĉapitrojn + Preterpasas %d ĉapitron, aŭ ĝi mankas ĉe la fonto aŭ ĝi estis elfiltrita + Preterpasas %d ĉapitrojn, aŭ ili mankas ĉe la fonto aŭ ili estis elfiltritaj 1 ŝanĝspurilo @@ -84,4 +84,12 @@ Sekva nelegita ĉapitro Sekvaj %d nelegitaj ĉapitroj + + %d deponejo + %d deponejoj + + + Disponebla ĝisdatigo de etendaĵo + Disponeblaj ĝisdatigoj de %d etendaĵoj + \ No newline at end of file diff --git a/i18n/src/commonMain/resources/MR/fr/plurals.xml b/i18n/src/commonMain/resources/MR/fr/plurals.xml index 31af18436..1ed8123ba 100644 --- a/i18n/src/commonMain/resources/MR/fr/plurals.xml +++ b/i18n/src/commonMain/resources/MR/fr/plurals.xml @@ -62,8 +62,8 @@ Chapitre suivant non lu - Les %d suivants non lus - Les %d suivants non lus + Les %d chapitres suivants non lus + Les %d chapitres suivants non lus Chapitre suivant diff --git a/i18n/src/commonMain/resources/MR/in/strings.xml b/i18n/src/commonMain/resources/MR/in/strings.xml index 156386787..8313f27e6 100644 --- a/i18n/src/commonMain/resources/MR/in/strings.xml +++ b/i18n/src/commonMain/resources/MR/in/strings.xml @@ -482,7 +482,7 @@ Gagal menyimpan sampul Sampul disimpan Sampul - Nonaktif + Matikan Aktif Panduan pelacakan Pengaturan per-kategori untuk urutan diff --git a/i18n/src/commonMain/resources/MR/ne/strings.xml b/i18n/src/commonMain/resources/MR/ne/strings.xml index 79e7ff5fe..9b9579c86 100644 --- a/i18n/src/commonMain/resources/MR/ne/strings.xml +++ b/i18n/src/commonMain/resources/MR/ne/strings.xml @@ -111,7 +111,7 @@ उल्टो चयन गर्नुहोस् राखिएको मिती अध्याय ल्याएको मिति - सबैभन्दा नयाँ अध्याय + नवीनतम अध्याय पुस्तकालय अपडेट गर्दा नयाँ आवरण र विवरणहरूको लागि जाँच गर्नुहोस् मेटाडेटा स्वतः रिफ्रेस गर्नुहोस् \"समाप्त\" स्थिति भएको @@ -395,7 +395,7 @@ लोकल स्रोत अन्य ट्याबहरू - सबैभन्दा नयाँ + नवीनतम द्वारा अर्डर गर्नुहोस् मिति %1$s मा लगइन गर्नुहोस् diff --git a/i18n/src/commonMain/resources/MR/pl/strings.xml b/i18n/src/commonMain/resources/MR/pl/strings.xml index efc1074d6..7933894aa 100644 --- a/i18n/src/commonMain/resources/MR/pl/strings.xml +++ b/i18n/src/commonMain/resources/MR/pl/strings.xml @@ -699,7 +699,7 @@ Przenieś serię na dół Nigdy Wybierz folder - Następna aktualizacja spodziewana za około %1$s, sprawdzanie co %2$s + Następna aktualizacja spodziewana za około %1$s, sprawdzanie co %2$s. Folder musi być wybrany Uprawnienia powiadomień Sortuj kategorie diff --git a/i18n/src/commonMain/resources/MR/tr/plurals.xml b/i18n/src/commonMain/resources/MR/tr/plurals.xml index 17a0f19ce..d3ecb0215 100644 --- a/i18n/src/commonMain/resources/MR/tr/plurals.xml +++ b/i18n/src/commonMain/resources/MR/tr/plurals.xml @@ -25,8 +25,8 @@ %1$s kaldı - %d ulam - %d ulam + %d kategori + %d kategoriler %1$s içinde %2$s hatayla tamamlandı diff --git a/i18n/src/commonMain/resources/MR/uk/plurals.xml b/i18n/src/commonMain/resources/MR/uk/plurals.xml index 39ba18f69..07409aab2 100644 --- a/i18n/src/commonMain/resources/MR/uk/plurals.xml +++ b/i18n/src/commonMain/resources/MR/uk/plurals.xml @@ -36,8 +36,8 @@ %d категорій - %1$s залишилось - %1$s залишилось + %1$s залишився + %1$s залишились %1$s залишилось %1$s залишилось @@ -67,15 +67,15 @@ Учора - %1$d днів тому + %1$d дні тому %1$d днів тому %1$d днів тому Наступний непрочитаний розділ Наступні %d непрочитані розділи - Наступні %d непрочитані розділи - Наступні %d непрочитані розділи + Наступні %d непрочитаних розділів + Наступні %d непрочитаних розділів Наступний розділ diff --git a/i18n/src/commonMain/resources/MR/zh-rTW/strings.xml b/i18n/src/commonMain/resources/MR/zh-rTW/strings.xml index 68aeaa685..c4789df77 100644 --- a/i18n/src/commonMain/resources/MR/zh-rTW/strings.xml +++ b/i18n/src/commonMain/resources/MR/zh-rTW/strings.xml @@ -188,7 +188,7 @@ 已清除快取,刪除了 %1$d 個檔案 清除時發生錯誤 已清除 Cookie - 協助我們修復錯誤,傳送的資料將不包含個人敏感訊息 + 協助我們修復錯誤,傳送的資料將不包含個人敏感資訊 登入 %1$s 使用者名稱 正在更新類別 @@ -448,7 +448,7 @@ 左邊 上一頁 下一頁 - 章節獲取日期 + 章節擷取日期 右邊 橫向 快顯選單 diff --git a/presentation-core/build.gradle.kts b/presentation-core/build.gradle.kts index f36ca3857..95aee376b 100644 --- a/presentation-core/build.gradle.kts +++ b/presentation-core/build.gradle.kts @@ -21,7 +21,7 @@ android { } dependencies { - api(projects.core) + api(projects.core.common) api(projects.i18n) // Compose diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt index 10d3039c9..9c2adf630 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt @@ -4,6 +4,7 @@ import android.content.res.Configuration.ORIENTATION_LANDSCAPE import androidx.activity.compose.BackHandler import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.tween +import androidx.compose.animation.rememberSplineBasedDecay import androidx.compose.foundation.clickable import androidx.compose.foundation.gestures.AnchoredDraggableState import androidx.compose.foundation.gestures.DraggableAnchors @@ -12,17 +13,14 @@ import androidx.compose.foundation.gestures.anchoredDraggable import androidx.compose.foundation.gestures.animateTo import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.offset -import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.requiredWidthIn -import androidx.compose.foundation.layout.systemBars +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.systemBarsPadding import androidx.compose.foundation.layout.widthIn -import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.runtime.Composable @@ -121,12 +119,14 @@ fun AdaptiveSheet( } } } else { + val decayAnimationSpec = rememberSplineBasedDecay() val anchoredDraggableState = remember { AnchoredDraggableState( initialValue = 1, - animationSpec = sheetAnimationSpec, positionalThreshold = { with(density) { 56.dp.toPx() } }, velocityThreshold = { with(density) { 125.dp.toPx() } }, + snapAnimationSpec = sheetAnimationSpec, + decayAnimationSpec = decayAnimationSpec, ) } val internalOnDismissRequest = { @@ -185,10 +185,8 @@ fun AdaptiveSheet( orientation = Orientation.Vertical, enabled = enableSwipeDismiss, ) - .windowInsetsPadding( - WindowInsets.systemBars - .only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal), - ), + .navigationBarsPadding() + .statusBarsPadding(), shape = MaterialTheme.shapes.extraLarge, tonalElevation = tonalElevation, content = { diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/Pager.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/Pager.kt index 521f988b8..fb3cbdf74 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/Pager.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/Pager.kt @@ -40,7 +40,7 @@ fun HorizontalPager( modifier = modifier, contentPadding = contentPadding, pageSize = pageSize, - beyondBoundsPageCount = beyondBoundsPageCount, + outOfBoundsPageCount = beyondBoundsPageCount, pageSpacing = pageSpacing, verticalAlignment = verticalAlignment, flingBehavior = PagerDefaults.flingBehavior( diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/SettingsItems.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/SettingsItems.kt index 5245e4631..c3e138f65 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/SettingsItems.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/SettingsItems.kt @@ -55,9 +55,9 @@ import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp import dev.icerock.moko.resources.StringResource import kotlinx.coroutines.delay -import tachiyomi.core.preference.Preference -import tachiyomi.core.preference.TriState -import tachiyomi.core.preference.toggle +import tachiyomi.core.common.preference.Preference +import tachiyomi.core.common.preference.TriState +import tachiyomi.core.common.preference.toggle import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.theme.header diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Surface.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Surface.kt index eda45695f..f6def1224 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Surface.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Surface.kt @@ -6,7 +6,7 @@ import androidx.compose.foundation.border import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box -import androidx.compose.material.ripple.rememberRipple +import androidx.compose.material.ripple import androidx.compose.material3.ColorScheme import androidx.compose.material3.LocalAbsoluteTonalElevation import androidx.compose.material3.LocalContentColor @@ -70,7 +70,7 @@ fun Surface( ) .combinedClickable( interactionSource = interactionSource, - indication = rememberRipple(), + indication = ripple(), enabled = enabled, role = Role.Button, onLongClick = onLongClick, diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/i18n/Localize.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/i18n/Localize.kt index 081281f7f..93013ba2b 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/i18n/Localize.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/i18n/Localize.kt @@ -5,8 +5,8 @@ import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.ui.platform.LocalContext import dev.icerock.moko.resources.PluralsResource import dev.icerock.moko.resources.StringResource -import tachiyomi.core.i18n.pluralStringResource -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.pluralStringResource +import tachiyomi.core.common.i18n.stringResource @Composable @ReadOnlyComposable diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt index c68818927..4b7a5018a 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.State import androidx.compose.runtime.collectAsState import androidx.compose.runtime.remember -import tachiyomi.core.preference.Preference +import tachiyomi.core.common.preference.Preference @Composable fun Preference.collectAsState(): State { diff --git a/presentation-widget/build.gradle.kts b/presentation-widget/build.gradle.kts index d3e56e373..87f59f95a 100644 --- a/presentation-widget/build.gradle.kts +++ b/presentation-widget/build.gradle.kts @@ -21,7 +21,7 @@ android { } dependencies { - implementation(projects.core) + implementation(projects.core.common) implementation(projects.domain) implementation(projects.presentationCore) api(projects.i18n) diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/LockedAnimeWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/LockedAnimeWidget.kt index b4cd1c991..2d97ba303 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/LockedAnimeWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/LockedAnimeWidget.kt @@ -15,7 +15,7 @@ import androidx.glance.text.Text import androidx.glance.text.TextAlign import androidx.glance.text.TextStyle import androidx.glance.unit.ColorProvider -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/UpdatesAnimeWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/UpdatesAnimeWidget.kt index a1acab79d..37873256e 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/UpdatesAnimeWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/anime/UpdatesAnimeWidget.kt @@ -21,7 +21,7 @@ import androidx.glance.layout.padding import androidx.glance.text.Text import androidx.glance.text.TextStyle import androidx.glance.unit.ColorProvider -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import kotlinx.collections.immutable.ImmutableList import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/LockedMangaWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/LockedMangaWidget.kt index 6625916aa..33c804494 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/LockedMangaWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/LockedMangaWidget.kt @@ -15,7 +15,7 @@ import androidx.glance.text.Text import androidx.glance.text.TextAlign import androidx.glance.text.TextStyle import androidx.glance.unit.ColorProvider -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/UpdatesMangaWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/UpdatesMangaWidget.kt index 8a3024264..1e35adbd6 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/UpdatesMangaWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/components/manga/UpdatesMangaWidget.kt @@ -21,7 +21,7 @@ import androidx.glance.layout.padding import androidx.glance.text.Text import androidx.glance.text.TextStyle import androidx.glance.unit.ColorProvider -import eu.kanade.tachiyomi.core.Constants +import eu.kanade.tachiyomi.core.common.Constants import kotlinx.collections.immutable.ImmutableList import tachiyomi.i18n.MR import tachiyomi.presentation.core.i18n.stringResource diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/AnimeWidgetManager.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/AnimeWidgetManager.kt index cd6d8ede7..68b919eeb 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/AnimeWidgetManager.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/AnimeWidgetManager.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.updates.anime.interactor.GetAnimeUpdates class AnimeWidgetManager( diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/BaseAnimeUpdatesGridGlanceWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/BaseAnimeUpdatesGridGlanceWidget.kt index 03d499206..eae6befc4 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/BaseAnimeUpdatesGridGlanceWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/anime/BaseAnimeUpdatesGridGlanceWidget.kt @@ -33,7 +33,7 @@ import eu.kanade.tachiyomi.util.system.dpToPx import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.flow.map -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.entries.anime.model.AnimeCover import tachiyomi.domain.updates.anime.interactor.GetAnimeUpdates import tachiyomi.domain.updates.anime.model.AnimeUpdatesWithRelations diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/BaseMangaUpdatesGridGlanceWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/BaseMangaUpdatesGridGlanceWidget.kt index 4f8f03f7e..7a5680c0f 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/BaseMangaUpdatesGridGlanceWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/BaseMangaUpdatesGridGlanceWidget.kt @@ -33,7 +33,7 @@ import eu.kanade.tachiyomi.util.system.dpToPx import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.flow.map -import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.common.util.lang.withIOContext import tachiyomi.domain.entries.manga.model.MangaCover import tachiyomi.domain.updates.manga.interactor.GetMangaUpdates import tachiyomi.domain.updates.manga.model.MangaUpdatesWithRelations diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/MangaWidgetManager.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/MangaWidgetManager.kt index eb791bdfc..e30c567ed 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/MangaWidgetManager.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/entries/manga/MangaWidgetManager.kt @@ -10,7 +10,7 @@ import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import logcat.LogPriority -import tachiyomi.core.util.system.logcat +import tachiyomi.core.common.util.system.logcat import tachiyomi.domain.updates.manga.interactor.GetMangaUpdates class MangaWidgetManager( diff --git a/settings.gradle.kts b/settings.gradle.kts index 2b738acdc..e47d86464 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -39,13 +39,13 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") rootProject.name = "Aniyomi" include(":app") -include(":i18n") -include(":source-api") -include(":core") -include(":macrobenchmark") +include(":core-metadata") +include(":core:common") include(":data") include(":domain") -include(":presentation-widget") +include(":i18n") +include(":macrobenchmark") include(":presentation-core") +include(":presentation-widget") +include(":source-api") include(":source-local") -include(":core-metadata") diff --git a/source-api/build.gradle.kts b/source-api/build.gradle.kts index c3d404018..3eb65aadf 100644 --- a/source-api/build.gradle.kts +++ b/source-api/build.gradle.kts @@ -17,7 +17,7 @@ kotlin { } val androidMain by getting { dependencies { - implementation(projects.core) + implementation(projects.core.common) api(libs.preferencektx) // Workaround for https://youtrack.jetbrains.com/issue/KT-57605 diff --git a/source-api/src/androidMain/kotlin/eu/kanade/tachiyomi/util/RxExtension.kt b/source-api/src/androidMain/kotlin/eu/kanade/tachiyomi/util/RxExtension.kt index 6938bb406..43fe01d83 100644 --- a/source-api/src/androidMain/kotlin/eu/kanade/tachiyomi/util/RxExtension.kt +++ b/source-api/src/androidMain/kotlin/eu/kanade/tachiyomi/util/RxExtension.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.util import rx.Observable -import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.common.util.lang.awaitSingle actual suspend fun Observable.awaitSingle(): T = awaitSingle() diff --git a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/AnimeCatalogueSource.kt b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/AnimeCatalogueSource.kt index 171072dc0..15cf58baa 100644 --- a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/AnimeCatalogueSource.kt +++ b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/AnimeCatalogueSource.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.animesource import eu.kanade.tachiyomi.animesource.model.AnimeFilterList import eu.kanade.tachiyomi.animesource.model.AnimesPage import rx.Observable -import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.common.util.lang.awaitSingle interface AnimeCatalogueSource : AnimeSource { diff --git a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/online/AnimeHttpSource.kt b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/online/AnimeHttpSource.kt index 5ed884b69..c24c8b370 100644 --- a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/online/AnimeHttpSource.kt +++ b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/animesource/online/AnimeHttpSource.kt @@ -17,7 +17,7 @@ import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response import rx.Observable -import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.common.util.lang.awaitSingle import uy.kohesive.injekt.injectLazy import java.net.URI import java.net.URISyntaxException diff --git a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/CatalogueSource.kt b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/CatalogueSource.kt index 3caef2abd..3eca169f4 100644 --- a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/CatalogueSource.kt +++ b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/CatalogueSource.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.source import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage import rx.Observable -import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.common.util.lang.awaitSingle interface CatalogueSource : MangaSource { diff --git a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/online/HttpSource.kt b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/online/HttpSource.kt index fb67d3270..1e2e0832d 100644 --- a/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/online/HttpSource.kt +++ b/source-api/src/commonMain/kotlin/eu/kanade/tachiyomi/source/online/HttpSource.kt @@ -16,7 +16,7 @@ import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response import rx.Observable -import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.common.util.lang.awaitSingle import uy.kohesive.injekt.injectLazy import java.net.URI import java.net.URISyntaxException diff --git a/source-local/build.gradle.kts b/source-local/build.gradle.kts index 5e9022026..7238720a4 100644 --- a/source-local/build.gradle.kts +++ b/source-local/build.gradle.kts @@ -12,12 +12,12 @@ kotlin { api(projects.i18n) implementation(libs.unifile) - implementation(libs.junrar) + implementation(libs.bundles.archive) } } val androidMain by getting { dependencies { - implementation(projects.core) + implementation(projects.core.common) implementation(projects.coreMetadata) // Move ChapterRecognition to separate module? diff --git a/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/anime/LocalAnimeSource.kt b/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/anime/LocalAnimeSource.kt index e30d47e0f..e7051e960 100644 --- a/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/anime/LocalAnimeSource.kt +++ b/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/anime/LocalAnimeSource.kt @@ -18,13 +18,13 @@ import kotlinx.serialization.json.Json import kotlinx.serialization.json.decodeFromStream import logcat.LogPriority import rx.Observable -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.extension +import tachiyomi.core.common.storage.nameWithoutExtension +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.logcat import tachiyomi.core.metadata.tachiyomi.AnimeDetails import tachiyomi.core.metadata.tachiyomi.EpisodeDetails -import tachiyomi.core.storage.extension -import tachiyomi.core.storage.nameWithoutExtension -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.logcat import tachiyomi.domain.entries.anime.model.Anime import tachiyomi.domain.items.episode.service.EpisodeRecognition import tachiyomi.i18n.MR diff --git a/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/manga/LocalMangaSource.kt b/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/manga/LocalMangaSource.kt index 66e122bac..b8e0e6a19 100644 --- a/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/manga/LocalMangaSource.kt +++ b/source-local/src/androidMain/kotlin/tachiyomi/source/local/entries/manga/LocalMangaSource.kt @@ -18,19 +18,20 @@ import kotlinx.serialization.json.decodeFromStream import logcat.LogPriority import nl.adaptivity.xmlutil.AndroidXmlReader import nl.adaptivity.xmlutil.serialization.XML -import tachiyomi.core.i18n.stringResource +import org.apache.commons.compress.archivers.zip.ZipFile +import tachiyomi.core.common.i18n.stringResource +import tachiyomi.core.common.storage.extension +import tachiyomi.core.common.storage.nameWithoutExtension +import tachiyomi.core.common.storage.openReadOnlyChannel +import tachiyomi.core.common.util.lang.withIOContext +import tachiyomi.core.common.util.system.ImageUtil +import tachiyomi.core.common.util.system.logcat import tachiyomi.core.metadata.comicinfo.COMIC_INFO_FILE import tachiyomi.core.metadata.comicinfo.ComicInfo import tachiyomi.core.metadata.comicinfo.copyFromComicInfo import tachiyomi.core.metadata.comicinfo.getComicInfo import tachiyomi.core.metadata.tachiyomi.ChapterDetails import tachiyomi.core.metadata.tachiyomi.MangaDetails -import tachiyomi.core.storage.UniFileTempFileManager -import tachiyomi.core.storage.extension -import tachiyomi.core.storage.nameWithoutExtension -import tachiyomi.core.util.lang.withIOContext -import tachiyomi.core.util.system.ImageUtil -import tachiyomi.core.util.system.logcat import tachiyomi.domain.entries.manga.model.Manga import tachiyomi.domain.items.chapter.service.ChapterRecognition import tachiyomi.i18n.MR @@ -41,13 +42,11 @@ import tachiyomi.source.local.io.Format import tachiyomi.source.local.io.manga.LocalMangaSourceFileSystem import tachiyomi.source.local.metadata.fillMetadata import uy.kohesive.injekt.injectLazy -import java.io.File import java.io.InputStream import java.nio.charset.StandardCharsets import java.text.SimpleDateFormat import java.util.Locale import java.util.concurrent.TimeUnit -import java.util.zip.ZipFile import kotlin.math.abs import com.github.junrar.Archive as JunrarArchive @@ -59,7 +58,6 @@ actual class LocalMangaSource( private val json: Json by injectLazy() private val xml: XML by injectLazy() - private val tempFileManager: UniFileTempFileManager by injectLazy() private val POPULAR_FILTERS = FilterList(MangaOrderBy.Popular(context)) private val LATEST_FILTERS = FilterList(MangaOrderBy.Latest(context)) @@ -149,8 +147,8 @@ actual class LocalMangaSource( // Augment manga details based on metadata files try { - val mangaDir by lazy { fileSystem.getMangaDirectory(manga.url) } - val mangaDirFiles = fileSystem.getFilesInMangaDirectory(manga.url) + val mangaDir = fileSystem.getMangaDirectory(manga.url) ?: error("${manga.url} is not a valid directory") + val mangaDirFiles = mangaDir.listFiles().orEmpty() val comicInfoFile = mangaDirFiles .firstOrNull { it.name == COMIC_INFO_FILE } @@ -180,7 +178,7 @@ actual class LocalMangaSource( // Replace with ComicInfo.xml file val comicInfo = manga.getComicInfo() mangaDir - ?.createFile(COMIC_INFO_FILE) + .createFile(COMIC_INFO_FILE) ?.openOutputStream() ?.use { val comicInfoString = xml.encodeToString(ComicInfo.serializer(), comicInfo) @@ -195,14 +193,12 @@ actual class LocalMangaSource( .filter(ArchiveManga::isSupported) .toList() - val folderPath = mangaDir?.filePath - - val copiedFile = copyComicInfoFileFromArchive(chapterArchives, folderPath) + val copiedFile = copyComicInfoFileFromArchive(chapterArchives, mangaDir) if (copiedFile != null) { - setMangaDetailsFromComicInfoFile(copiedFile.inputStream(), manga) + setMangaDetailsFromComicInfoFile(copiedFile.openInputStream(), manga) } else { // Avoid re-scanning - mangaDir?.createFile(".noxml") + mangaDir.createFile(".noxml") } } } @@ -216,23 +212,23 @@ actual class LocalMangaSource( return@withIOContext manga } - private fun copyComicInfoFileFromArchive(chapterArchives: List, folderPath: String?): File? { + private fun copyComicInfoFileFromArchive(chapterArchives: List, folder: UniFile): UniFile? { for (chapter in chapterArchives) { when (Format.valueOf(chapter)) { is Format.Zip -> { - ZipFile(tempFileManager.createTempFile(chapter)).use { zip: ZipFile -> + ZipFile(chapter.openReadOnlyChannel(context)).use { zip: ZipFile -> zip.getEntry(COMIC_INFO_FILE)?.let { comicInfoFile -> zip.getInputStream(comicInfoFile).buffered().use { stream -> - return copyComicInfoFile(stream, folderPath) + return copyComicInfoFile(stream, folder) } } } } is Format.Rar -> { - JunrarArchive(tempFileManager.createTempFile(chapter)).use { rar -> + JunrarArchive(chapter.openInputStream()).use { rar -> rar.fileHeaders.firstOrNull { it.fileName == COMIC_INFO_FILE }?.let { comicInfoFile -> rar.getInputStream(comicInfoFile).buffered().use { stream -> - return copyComicInfoFile(stream, folderPath) + return copyComicInfoFile(stream, folder) } } } @@ -243,9 +239,9 @@ actual class LocalMangaSource( return null } - private fun copyComicInfoFile(comicInfoFileStream: InputStream, folderPath: String?): File { - return File("$folderPath/$COMIC_INFO_FILE").apply { - outputStream().use { outputStream -> + private fun copyComicInfoFile(comicInfoFileStream: InputStream, folder: UniFile): UniFile? { + return folder.createFile(COMIC_INFO_FILE)?.apply { + openOutputStream().use { outputStream -> comicInfoFileStream.use { it.copyTo(outputStream) } } } @@ -290,7 +286,7 @@ actual class LocalMangaSource( val format = Format.valueOf(chapterFile) if (format is Format.Epub) { - EpubFile(tempFileManager.createTempFile(format.file)).use { epub -> + EpubFile(format.file.openReadOnlyChannel(context)).use { epub -> epub.fillMetadata(manga, this) } } @@ -368,8 +364,8 @@ actual class LocalMangaSource( entry?.let { coverManager.update(manga, it.openInputStream()) } } is Format.Zip -> { - ZipFile(tempFileManager.createTempFile(format.file)).use { zip -> - val entry = zip.entries().toList() + ZipFile(format.file.openReadOnlyChannel(context)).use { zip -> + val entry = zip.entries.toList() .sortedWith { f1, f2 -> f1.name.compareToCaseInsensitiveNaturalOrder( f2.name, @@ -387,7 +383,7 @@ actual class LocalMangaSource( } } is Format.Rar -> { - JunrarArchive(tempFileManager.createTempFile(format.file)).use { archive -> + JunrarArchive(format.file.openInputStream()).use { archive -> val entry = archive.fileHeaders .sortedWith { f1, f2 -> f1.fileName.compareToCaseInsensitiveNaturalOrder( @@ -406,7 +402,7 @@ actual class LocalMangaSource( } } is Format.Epub -> { - EpubFile(tempFileManager.createTempFile(format.file)).use { epub -> + EpubFile(format.file.openReadOnlyChannel(context)).use { epub -> val entry = epub.getImagesFromPages() .firstOrNull() ?.let { epub.getEntry(it) } diff --git a/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/anime/AnimeOrderBy.kt b/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/anime/AnimeOrderBy.kt index 397b6d33c..5e8cad8f0 100644 --- a/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/anime/AnimeOrderBy.kt +++ b/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/anime/AnimeOrderBy.kt @@ -2,7 +2,7 @@ package tachiyomi.source.local.filter.anime import android.content.Context import eu.kanade.tachiyomi.animesource.model.AnimeFilter -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR sealed class AnimeOrderBy(context: Context, selection: Selection) : AnimeFilter.Sort( diff --git a/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/manga/MangaOrderBy.kt b/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/manga/MangaOrderBy.kt index 0c24744f1..3a9024283 100644 --- a/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/manga/MangaOrderBy.kt +++ b/source-local/src/androidMain/kotlin/tachiyomi/source/local/filter/manga/MangaOrderBy.kt @@ -2,7 +2,7 @@ package tachiyomi.source.local.filter.manga import android.content.Context import eu.kanade.tachiyomi.source.model.Filter -import tachiyomi.core.i18n.stringResource +import tachiyomi.core.common.i18n.stringResource import tachiyomi.i18n.MR sealed class MangaOrderBy(context: Context, selection: Selection) : Filter.Sort( diff --git a/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/anime/LocalAnimeCoverManager.kt b/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/anime/LocalAnimeCoverManager.kt index 0a5c3b8f7..838efc50f 100644 --- a/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/anime/LocalAnimeCoverManager.kt +++ b/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/anime/LocalAnimeCoverManager.kt @@ -4,8 +4,8 @@ import android.content.Context import com.hippo.unifile.UniFile import eu.kanade.tachiyomi.animesource.model.SAnime import eu.kanade.tachiyomi.util.storage.DiskUtil -import tachiyomi.core.storage.nameWithoutExtension -import tachiyomi.core.util.system.ImageUtil +import tachiyomi.core.common.storage.nameWithoutExtension +import tachiyomi.core.common.util.system.ImageUtil import tachiyomi.source.local.io.anime.LocalAnimeSourceFileSystem import java.io.InputStream diff --git a/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/manga/LocalMangaCoverManager.kt b/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/manga/LocalMangaCoverManager.kt index 4f593de5a..1ada7aea6 100644 --- a/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/manga/LocalMangaCoverManager.kt +++ b/source-local/src/androidMain/kotlin/tachiyomi/source/local/image/manga/LocalMangaCoverManager.kt @@ -4,8 +4,8 @@ import android.content.Context import com.hippo.unifile.UniFile import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.util.storage.DiskUtil -import tachiyomi.core.storage.nameWithoutExtension -import tachiyomi.core.util.system.ImageUtil +import tachiyomi.core.common.storage.nameWithoutExtension +import tachiyomi.core.common.util.system.ImageUtil import tachiyomi.source.local.io.manga.LocalMangaSourceFileSystem import java.io.InputStream diff --git a/source-local/src/androidMain/kotlin/tachiyomi/source/local/io/manga/LocalMangaSourceFileSystem.kt b/source-local/src/androidMain/kotlin/tachiyomi/source/local/io/manga/LocalMangaSourceFileSystem.kt index 9f6039ba4..e75fbcbb5 100644 --- a/source-local/src/androidMain/kotlin/tachiyomi/source/local/io/manga/LocalMangaSourceFileSystem.kt +++ b/source-local/src/androidMain/kotlin/tachiyomi/source/local/io/manga/LocalMangaSourceFileSystem.kt @@ -22,9 +22,6 @@ actual class LocalMangaSourceFileSystem( } actual fun getFilesInMangaDirectory(name: String): List { - return getBaseDirectory() - ?.findFile(name, true) - ?.takeIf { it.isDirectory } - ?.listFiles().orEmpty().toList() + return getMangaDirectory(name)?.listFiles().orEmpty().toList() } } diff --git a/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt b/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt index 45b2ea952..3a19de5a3 100644 --- a/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt +++ b/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Archive.kt @@ -1,7 +1,7 @@ package tachiyomi.source.local.io import com.hippo.unifile.UniFile -import tachiyomi.core.storage.extension +import tachiyomi.core.common.storage.extension object ArchiveAnime { diff --git a/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Format.kt b/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Format.kt index 0f29ae8ab..5b22e41e2 100644 --- a/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Format.kt +++ b/source-local/src/commonMain/kotlin/tachiyomi/source/local/io/Format.kt @@ -1,7 +1,7 @@ package tachiyomi.source.local.io import com.hippo.unifile.UniFile -import tachiyomi.core.storage.extension +import tachiyomi.core.common.storage.extension sealed interface Format { data class Directory(val file: UniFile) : Format