From 1730dd6af1f5a9e6f8752a2350b1bd153262a751 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 27 Jan 2023 22:31:12 -0500 Subject: [PATCH] Move more things around --- .../kanade/core/prefs/PreferenceMutableState.kt | 2 +- .../eu/kanade/data/source/NoResultsException.kt | 3 --- .../java/eu/kanade/data/source/SourceMapper.kt | 5 ----- .../eu/kanade/data/source/SourcePagingSource.kt | 6 ++++-- .../main/java/eu/kanade/domain/DomainModule.kt | 2 +- .../domain/backup/service/BackupPreferences.kt | 4 ++-- .../eu/kanade/domain/base/BasePreferences.kt | 2 +- .../domain/base/ExtensionInstallerPreference.kt | 6 +++--- .../interactor/CreateCategoryWithName.kt | 4 ++-- .../domain/category/interactor/DeleteCategory.kt | 4 ++-- .../domain/category/interactor/RenameCategory.kt | 4 ++-- .../category/interactor/ReorderCategory.kt | 4 ++-- .../category/interactor/SetMangaCategories.kt | 2 +- .../domain/category/interactor/UpdateCategory.kt | 2 +- .../domain/chapter/interactor/GetChapter.kt | 2 +- .../chapter/interactor/GetChapterByMangaId.kt | 2 +- .../interactor/SetDefaultChapterSettings.kt | 2 +- .../domain/chapter/interactor/SetReadStatus.kt | 4 ++-- .../SyncChaptersWithTrackServiceTwoWay.kt | 2 +- .../domain/chapter/interactor/UpdateChapter.kt | 2 +- .../domain/download/interactor/DeleteDownload.kt | 2 +- .../download/service/DownloadPreferences.kt | 4 ++-- .../domain/library/service/LibraryPreferences.kt | 2 +- .../kanade/domain/manga/interactor/GetManga.kt | 2 +- .../domain/source/interactor/ToggleLanguage.kt | 2 +- .../domain/source/interactor/ToggleSource.kt | 2 +- .../domain/source/interactor/ToggleSourcePin.kt | 2 +- .../domain/source/service/SourcePreferences.kt | 4 ++-- .../domain/track/interactor/DeleteTrack.kt | 2 +- .../kanade/domain/track/interactor/GetTracks.kt | 2 +- .../domain/track/interactor/InsertTrack.kt | 2 +- .../track/service/DelayedTrackingUpdateJob.kt | 4 ++-- .../domain/track/service/TrackPreferences.kt | 2 +- .../domain/track/store/DelayedTrackingStore.kt | 2 +- .../java/eu/kanade/domain/ui/UiPreferences.kt | 4 ++-- .../browse/components/BrowseIcons.kt | 2 +- .../presentation/more/settings/PreferenceItem.kt | 2 +- .../more/settings/PreferenceModel.kt | 2 +- .../more/settings/screen/AboutScreen.kt | 6 +++--- .../more/settings/screen/ClearDatabaseScreen.kt | 6 +++--- .../settings/screen/SettingsAdvancedScreen.kt | 6 +++--- .../settings/screen/SettingsTrackingScreen.kt | 4 ++-- .../eu/kanade/presentation/util/Preference.kt | 2 +- app/src/main/java/eu/kanade/tachiyomi/App.kt | 2 +- .../main/java/eu/kanade/tachiyomi/AppModule.kt | 8 ++++---- .../main/java/eu/kanade/tachiyomi/Migrations.kt | 2 +- .../tachiyomi/crash/GlobalExceptionHandler.kt | 2 +- .../tachiyomi/data/backup/BackupCreatorJob.kt | 2 +- .../tachiyomi/data/backup/BackupManager.kt | 4 ++-- .../data/backup/BackupRestoreService.kt | 2 +- .../tachiyomi/data/coil/MangaCoverFetcher.kt | 2 +- .../tachiyomi/data/download/DownloadCache.kt | 6 +++--- .../tachiyomi/data/download/DownloadManager.kt | 4 ++-- .../tachiyomi/data/download/DownloadProvider.kt | 2 +- .../tachiyomi/data/download/DownloadService.kt | 4 ++-- .../kanade/tachiyomi/data/download/Downloader.kt | 8 ++++---- .../data/download/model/DownloadQueue.kt | 2 +- .../data/library/LibraryUpdateNotifier.kt | 2 +- .../data/library/LibraryUpdateService.kt | 6 +++--- .../data/notification/NotificationReceiver.kt | 2 +- .../eu/kanade/tachiyomi/data/saver/ImageSaver.kt | 2 +- .../kanade/tachiyomi/data/track/TrackService.kt | 6 +++--- .../tachiyomi/data/track/anilist/AnilistApi.kt | 2 +- .../tachiyomi/data/track/bangumi/BangumiApi.kt | 2 +- .../tachiyomi/data/track/kavita/KavitaApi.kt | 4 ++-- .../tachiyomi/data/track/kitsu/KitsuApi.kt | 2 +- .../tachiyomi/data/track/komga/KomgaApi.kt | 4 ++-- .../data/track/mangaupdates/MangaUpdatesApi.kt | 2 +- .../data/track/myanimelist/MyAnimeListApi.kt | 2 +- .../data/track/shikimori/ShikimoriApi.kt | 2 +- .../data/track/suwayomi/TachideskApi.kt | 2 +- .../tachiyomi/data/updater/AppUpdateChecker.kt | 6 +++--- .../tachiyomi/data/updater/AppUpdateJob.kt | 2 +- .../tachiyomi/data/updater/AppUpdateService.kt | 4 ++-- .../tachiyomi/extension/ExtensionManager.kt | 6 +++--- .../tachiyomi/extension/ExtensionUpdateJob.kt | 2 +- .../extension/api/ExtensionGithubApi.kt | 8 ++++---- .../installer/PackageInstallerInstaller.kt | 2 +- .../extension/installer/ShizukuInstaller.kt | 2 +- .../extension/util/ExtensionInstallReceiver.kt | 4 ++-- .../extension/util/ExtensionInstallService.kt | 2 +- .../extension/util/ExtensionInstaller.kt | 2 +- .../tachiyomi/extension/util/ExtensionLoader.kt | 2 +- .../eu/kanade/tachiyomi/source/LocalSource.kt | 4 ++-- .../extension/ExtensionFilterScreenModel.kt | 2 +- .../ui/browse/extension/ExtensionsScreenModel.kt | 2 +- .../details/ExtensionDetailsScreenModel.kt | 2 +- .../migration/manga/MigrationMangaScreenModel.kt | 2 +- .../ui/browse/migration/search/MigrateDialog.kt | 8 ++++---- .../sources/MigrateSourceScreenModel.kt | 4 ++-- .../ui/browse/source/SourcesScreenModel.kt | 4 ++-- .../browse/source/browse/BrowseSourceScreen.kt | 2 +- .../source/browse/BrowseSourceScreenModel.kt | 8 ++++---- .../source/globalsearch/SearchScreenModel.kt | 8 ++++---- .../tachiyomi/ui/download/DownloadQueueScreen.kt | 2 +- .../ui/download/DownloadQueueScreenModel.kt | 2 +- .../tachiyomi/ui/history/HistoryScreenModel.kt | 6 +++--- .../tachiyomi/ui/library/LibraryScreenModel.kt | 6 +++--- .../tachiyomi/ui/library/LibrarySettingsSheet.kt | 2 +- .../eu/kanade/tachiyomi/ui/library/LibraryTab.kt | 2 +- .../eu/kanade/tachiyomi/ui/main/MainActivity.kt | 2 +- .../tachiyomi/ui/manga/MangaCoverScreenModel.kt | 8 ++++---- .../eu/kanade/tachiyomi/ui/manga/MangaScreen.kt | 4 ++-- .../tachiyomi/ui/manga/MangaScreenModel.kt | 10 +++++----- .../tachiyomi/ui/manga/track/TrackInfoDialog.kt | 8 ++++---- .../java/eu/kanade/tachiyomi/ui/more/MoreTab.kt | 2 +- .../kanade/tachiyomi/ui/reader/ReaderActivity.kt | 8 ++++---- .../tachiyomi/ui/reader/ReaderViewModel.kt | 10 +++++----- .../tachiyomi/ui/reader/loader/ChapterLoader.kt | 4 ++-- .../tachiyomi/ui/reader/loader/HttpPageLoader.kt | 6 +++--- .../tachiyomi/ui/reader/model/ReaderChapter.kt | 2 +- .../reader/setting/ReaderColorFilterSettings.kt | 2 +- .../ui/reader/setting/ReaderPreferences.kt | 4 ++-- .../tachiyomi/ui/reader/viewer/ViewerConfig.kt | 2 +- .../ui/reader/viewer/pager/PagerViewer.kt | 2 +- .../ui/reader/viewer/pager/PagerViewerAdapter.kt | 2 +- .../ui/reader/viewer/webtoon/WebtoonAdapter.kt | 2 +- .../ui/reader/viewer/webtoon/WebtoonViewer.kt | 2 +- .../tachiyomi/ui/security/UnlockActivity.kt | 2 +- .../ui/setting/track/AnilistLoginActivity.kt | 2 +- .../ui/setting/track/BangumiLoginActivity.kt | 2 +- .../ui/setting/track/MyAnimeListLoginActivity.kt | 2 +- .../ui/setting/track/ShikimoriLoginActivity.kt | 2 +- .../tachiyomi/ui/stats/StatsScreenModel.kt | 2 +- .../tachiyomi/ui/updates/UpdatesScreenModel.kt | 6 +++--- .../tachiyomi/ui/webview/WebViewActivity.kt | 2 +- .../tachiyomi/ui/webview/WebViewScreenModel.kt | 2 +- .../eu/kanade/tachiyomi/util/CrashLogUtil.kt | 4 ++-- .../util/preference/PreferenceExtensions.kt | 2 +- .../tachiyomi/util/system/ContextExtensions.kt | 1 + .../eu/kanade/tachiyomi/util/system/ImageUtil.kt | 1 + .../tachiyomi/widget/MaterialSpinnerView.kt | 2 +- .../core/security/SecurityPreferences.kt | 4 ++-- .../kanade/tachiyomi/network/JavaScriptEngine.kt | 2 +- .../tachiyomi/network/NetworkPreferences.kt | 4 ++-- .../network/interceptor/WebViewInterceptor.kt | 2 +- .../kanade/tachiyomi/util/system/DeviceUtil.kt | 1 + .../kanade/tachiyomi/util/system/WebViewUtil.kt | 1 + .../core/preference/AndroidPreference.kt | 2 +- .../core/preference/AndroidPreferenceStore.kt | 16 ++++++++-------- .../tachiyomi/core/preference/Preference.kt | 2 +- .../tachiyomi/core/preference/PreferenceStore.kt | 2 +- .../core/provider/AndroidBackupFolderProvider.kt | 2 +- .../provider/AndroidDownloadFolderProvider.kt | 2 +- .../tachiyomi/core/provider/FolderProvider.kt | 2 +- .../core/util/lang}/BooleanExtensions.kt | 2 +- .../core}/util/lang/CoroutinesExtensions.kt | 2 +- .../core}/util/lang/RxCoroutineBridge.kt | 2 +- .../core}/util/system/LogcatExtensions.kt | 2 +- .../data/chapter/ChapterRepositoryImpl.kt | 4 ++-- .../data/history/HistoryRepositoryImpl.kt | 2 +- .../tachiyomi/data/manga/MangaRepositoryImpl.kt | 4 ++-- .../data/source/SourceDataRepositoryImpl.kt | 2 +- .../java/tachiyomi/data/source/SourceMapper.kt | 7 +++++++ presentation-core/build.gradle.kts | 2 +- presentation-widget/build.gradle.kts | 3 +-- .../widget/UpdatesGridGlanceWidget.kt | 2 +- .../java/eu/kanade/tachiyomi/source/Source.kt | 2 +- 158 files changed, 262 insertions(+), 258 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/data/source/NoResultsException.kt rename core/src/main/java/{eu/kanade => }/tachiyomi/core/preference/AndroidPreference.kt (99%) rename core/src/main/java/{eu/kanade => }/tachiyomi/core/preference/AndroidPreferenceStore.kt (79%) rename core/src/main/java/{eu/kanade => }/tachiyomi/core/preference/Preference.kt (91%) rename core/src/main/java/{eu/kanade => }/tachiyomi/core/preference/PreferenceStore.kt (96%) rename core/src/main/java/{eu/kanade => }/tachiyomi/core/provider/AndroidBackupFolderProvider.kt (93%) rename core/src/main/java/{eu/kanade => }/tachiyomi/core/provider/AndroidDownloadFolderProvider.kt (93%) rename core/src/main/java/{eu/kanade => }/tachiyomi/core/provider/FolderProvider.kt (70%) rename core/src/main/java/{eu/kanade/tachiyomi/util => tachiyomi/core/util/lang}/BooleanExtensions.kt (57%) rename core/src/main/java/{eu/kanade/tachiyomi => tachiyomi/core}/util/lang/CoroutinesExtensions.kt (98%) rename core/src/main/java/{eu/kanade/tachiyomi => tachiyomi/core}/util/lang/RxCoroutineBridge.kt (98%) rename core/src/main/java/{eu/kanade/tachiyomi => tachiyomi/core}/util/system/LogcatExtensions.kt (90%) rename {app/src/main/java/eu/kanade => data/src/main/java/tachiyomi}/data/source/SourceDataRepositoryImpl.kt (96%) create mode 100644 data/src/main/java/tachiyomi/data/source/SourceMapper.kt diff --git a/app/src/main/java/eu/kanade/core/prefs/PreferenceMutableState.kt b/app/src/main/java/eu/kanade/core/prefs/PreferenceMutableState.kt index b8c41b45f1..c33b240919 100644 --- a/app/src/main/java/eu/kanade/core/prefs/PreferenceMutableState.kt +++ b/app/src/main/java/eu/kanade/core/prefs/PreferenceMutableState.kt @@ -2,10 +2,10 @@ package eu.kanade.core.prefs import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf -import eu.kanade.tachiyomi.core.preference.Preference import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach +import tachiyomi.core.preference.Preference class PreferenceMutableState( private val preference: Preference, diff --git a/app/src/main/java/eu/kanade/data/source/NoResultsException.kt b/app/src/main/java/eu/kanade/data/source/NoResultsException.kt deleted file mode 100644 index e0eee5fc62..0000000000 --- a/app/src/main/java/eu/kanade/data/source/NoResultsException.kt +++ /dev/null @@ -1,3 +0,0 @@ -package eu.kanade.data.source - -class NoResultsException : Exception() diff --git a/app/src/main/java/eu/kanade/data/source/SourceMapper.kt b/app/src/main/java/eu/kanade/data/source/SourceMapper.kt index 509cfa33aa..0f3dd2f9b3 100644 --- a/app/src/main/java/eu/kanade/data/source/SourceMapper.kt +++ b/app/src/main/java/eu/kanade/data/source/SourceMapper.kt @@ -3,7 +3,6 @@ package eu.kanade.data.source import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.SourceManager import tachiyomi.domain.source.model.Source -import tachiyomi.domain.source.model.SourceData val sourceMapper: (eu.kanade.tachiyomi.source.Source) -> Source = { source -> Source( @@ -18,7 +17,3 @@ val sourceMapper: (eu.kanade.tachiyomi.source.Source) -> Source = { source -> val catalogueSourceMapper: (CatalogueSource) -> Source = { source -> sourceMapper(source).copy(supportsLatest = source.supportsLatest) } - -val sourceDataMapper: (Long, String, String) -> SourceData = { id, lang, name -> - SourceData(id, lang, name) -} diff --git a/app/src/main/java/eu/kanade/data/source/SourcePagingSource.kt b/app/src/main/java/eu/kanade/data/source/SourcePagingSource.kt index 87c6e1c51d..c5b724be70 100644 --- a/app/src/main/java/eu/kanade/data/source/SourcePagingSource.kt +++ b/app/src/main/java/eu/kanade/data/source/SourcePagingSource.kt @@ -6,8 +6,8 @@ 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 eu.kanade.tachiyomi.util.lang.awaitSingle -import eu.kanade.tachiyomi.util.lang.withIOContext +import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.util.lang.withIOContext abstract class SourcePagingSource( protected val source: CatalogueSource, @@ -60,3 +60,5 @@ class SourceLatestPagingSource(source: CatalogueSource) : SourcePagingSource(sou return source.fetchLatestUpdates(currentPage).awaitSingle() } } + +class NoResultsException : Exception() diff --git a/app/src/main/java/eu/kanade/domain/DomainModule.kt b/app/src/main/java/eu/kanade/domain/DomainModule.kt index 55c9ea9c5c..c1d19837c8 100644 --- a/app/src/main/java/eu/kanade/domain/DomainModule.kt +++ b/app/src/main/java/eu/kanade/domain/DomainModule.kt @@ -1,6 +1,5 @@ package eu.kanade.domain -import eu.kanade.data.source.SourceDataRepositoryImpl import eu.kanade.data.source.SourceRepositoryImpl import eu.kanade.domain.category.interactor.CreateCategoryWithName import eu.kanade.domain.category.interactor.DeleteCategory @@ -58,6 +57,7 @@ import tachiyomi.data.category.CategoryRepositoryImpl import tachiyomi.data.chapter.ChapterRepositoryImpl import tachiyomi.data.history.HistoryRepositoryImpl import tachiyomi.data.manga.MangaRepositoryImpl +import tachiyomi.data.source.SourceDataRepositoryImpl import tachiyomi.data.track.TrackRepositoryImpl import tachiyomi.data.updates.UpdatesRepositoryImpl import tachiyomi.domain.category.repository.CategoryRepository diff --git a/app/src/main/java/eu/kanade/domain/backup/service/BackupPreferences.kt b/app/src/main/java/eu/kanade/domain/backup/service/BackupPreferences.kt index 71c35745af..3623c5551a 100644 --- a/app/src/main/java/eu/kanade/domain/backup/service/BackupPreferences.kt +++ b/app/src/main/java/eu/kanade/domain/backup/service/BackupPreferences.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.backup.service -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.provider.FolderProvider +import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.provider.FolderProvider class BackupPreferences( private val folderProvider: FolderProvider, 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 986856c0c6..bf9ec8ec37 100644 --- a/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt +++ b/app/src/main/java/eu/kanade/domain/base/BasePreferences.kt @@ -1,9 +1,9 @@ package eu.kanade.domain.base import android.content.Context -import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.util.system.isPreviewBuildType import eu.kanade.tachiyomi.util.system.isReleaseBuildType +import tachiyomi.core.preference.PreferenceStore class BasePreferences( val context: Context, 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 89fc27b7fd..a981bd0ff9 100644 --- a/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt +++ b/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt @@ -1,13 +1,13 @@ package eu.kanade.domain.base import android.content.Context -import eu.kanade.tachiyomi.core.preference.Preference -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.preference.getEnum import eu.kanade.tachiyomi.data.preference.PreferenceValues.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 class ExtensionInstallerPreference( private val context: Context, diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/CreateCategoryWithName.kt b/app/src/main/java/eu/kanade/domain/category/interactor/CreateCategoryWithName.kt index 07e32d4345..b71911cebf 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/CreateCategoryWithName.kt +++ b/app/src/main/java/eu/kanade/domain/category/interactor/CreateCategoryWithName.kt @@ -1,9 +1,9 @@ package eu.kanade.domain.category.interactor import eu.kanade.domain.library.service.LibraryPreferences -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.repository.CategoryRepository diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/DeleteCategory.kt b/app/src/main/java/eu/kanade/domain/category/interactor/DeleteCategory.kt index 66af386b80..ac4216876b 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/DeleteCategory.kt +++ b/app/src/main/java/eu/kanade/domain/category/interactor/DeleteCategory.kt @@ -1,8 +1,8 @@ package eu.kanade.domain.category.interactor -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.CategoryUpdate import tachiyomi.domain.category.repository.CategoryRepository diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/RenameCategory.kt b/app/src/main/java/eu/kanade/domain/category/interactor/RenameCategory.kt index 1053cdd80a..9f423966dc 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/RenameCategory.kt +++ b/app/src/main/java/eu/kanade/domain/category/interactor/RenameCategory.kt @@ -1,8 +1,8 @@ package eu.kanade.domain.category.interactor -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate import tachiyomi.domain.category.repository.CategoryRepository diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/ReorderCategory.kt b/app/src/main/java/eu/kanade/domain/category/interactor/ReorderCategory.kt index 5df5940d93..4bbdb2fccb 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/ReorderCategory.kt +++ b/app/src/main/java/eu/kanade/domain/category/interactor/ReorderCategory.kt @@ -1,10 +1,10 @@ package eu.kanade.domain.category.interactor -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext -import eu.kanade.tachiyomi.util.system.logcat 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.domain.category.model.Category import tachiyomi.domain.category.model.CategoryUpdate import tachiyomi.domain.category.repository.CategoryRepository diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/SetMangaCategories.kt b/app/src/main/java/eu/kanade/domain/category/interactor/SetMangaCategories.kt index 04fafc5e2e..5ffa9e52a4 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/SetMangaCategories.kt +++ b/app/src/main/java/eu/kanade/domain/category/interactor/SetMangaCategories.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.category.interactor -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.repository.MangaRepository class SetMangaCategories( diff --git a/app/src/main/java/eu/kanade/domain/category/interactor/UpdateCategory.kt b/app/src/main/java/eu/kanade/domain/category/interactor/UpdateCategory.kt index 265017ab29..d2a1cc80a1 100644 --- a/app/src/main/java/eu/kanade/domain/category/interactor/UpdateCategory.kt +++ b/app/src/main/java/eu/kanade/domain/category/interactor/UpdateCategory.kt @@ -1,6 +1,6 @@ package eu.kanade.domain.category.interactor -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext +import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.domain.category.model.CategoryUpdate import tachiyomi.domain.category.repository.CategoryRepository diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapter.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapter.kt index 9f82fed704..175e43dbe1 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapter.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapter.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.chapter.interactor -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.repository.ChapterRepository diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapterByMangaId.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapterByMangaId.kt index c9c1dcbf89..4492b37d0d 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapterByMangaId.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/GetChapterByMangaId.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.chapter.interactor -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.repository.ChapterRepository diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt index 0e9ea95184..761d6ae082 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetDefaultChapterSettings.kt @@ -3,7 +3,7 @@ package eu.kanade.domain.chapter.interactor import eu.kanade.domain.library.service.LibraryPreferences import eu.kanade.domain.manga.interactor.GetFavorites import eu.kanade.domain.manga.interactor.SetMangaChapterFlags -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext +import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.domain.manga.model.Manga class SetMangaDefaultChapterFlags( diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt index 6a39e468f0..c740dc7a64 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt @@ -2,9 +2,9 @@ package eu.kanade.domain.chapter.interactor import eu.kanade.domain.download.interactor.DeleteDownload import eu.kanade.domain.download.service.DownloadPreferences -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.ChapterUpdate import tachiyomi.domain.chapter.repository.ChapterRepository diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt index 513b1c2eb7..ef78ac50a8 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SyncChaptersWithTrackServiceTwoWay.kt @@ -3,8 +3,8 @@ package eu.kanade.domain.chapter.interactor import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.tachiyomi.data.track.TrackService -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.toChapterUpdate import tachiyomi.domain.track.model.Track diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/UpdateChapter.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/UpdateChapter.kt index d2944733c5..1d372711bb 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/UpdateChapter.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/UpdateChapter.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.chapter.interactor -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.ChapterUpdate import tachiyomi.domain.chapter.repository.ChapterRepository diff --git a/app/src/main/java/eu/kanade/domain/download/interactor/DeleteDownload.kt b/app/src/main/java/eu/kanade/domain/download/interactor/DeleteDownload.kt index 95d94f9061..42a902c921 100644 --- a/app/src/main/java/eu/kanade/domain/download/interactor/DeleteDownload.kt +++ b/app/src/main/java/eu/kanade/domain/download/interactor/DeleteDownload.kt @@ -2,7 +2,7 @@ package eu.kanade.domain.download.interactor import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext +import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/domain/download/service/DownloadPreferences.kt b/app/src/main/java/eu/kanade/domain/download/service/DownloadPreferences.kt index 76b0465a6b..fcfcce1f93 100644 --- a/app/src/main/java/eu/kanade/domain/download/service/DownloadPreferences.kt +++ b/app/src/main/java/eu/kanade/domain/download/service/DownloadPreferences.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.download.service -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.provider.FolderProvider +import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.provider.FolderProvider class DownloadPreferences( private val folderProvider: FolderProvider, diff --git a/app/src/main/java/eu/kanade/domain/library/service/LibraryPreferences.kt b/app/src/main/java/eu/kanade/domain/library/service/LibraryPreferences.kt index 60d3dd56d6..2f3b126fe9 100644 --- a/app/src/main/java/eu/kanade/domain/library/service/LibraryPreferences.kt +++ b/app/src/main/java/eu/kanade/domain/library/service/LibraryPreferences.kt @@ -1,11 +1,11 @@ package eu.kanade.domain.library.service -import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.data.preference.DEVICE_ONLY_ON_WIFI import eu.kanade.tachiyomi.data.preference.MANGA_HAS_UNREAD import eu.kanade.tachiyomi.data.preference.MANGA_NON_COMPLETED import eu.kanade.tachiyomi.data.preference.MANGA_NON_READ import eu.kanade.tachiyomi.widget.ExtendedNavigationView +import tachiyomi.core.preference.PreferenceStore import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.library.model.LibrarySort import tachiyomi.domain.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/domain/manga/interactor/GetManga.kt b/app/src/main/java/eu/kanade/domain/manga/interactor/GetManga.kt index 7ea71048b9..c17ae09e7d 100644 --- a/app/src/main/java/eu/kanade/domain/manga/interactor/GetManga.kt +++ b/app/src/main/java/eu/kanade/domain/manga/interactor/GetManga.kt @@ -1,8 +1,8 @@ package eu.kanade.domain.manga.interactor -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.flow.Flow import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.repository.MangaRepository 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 a266892186..bc601117b2 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 eu.kanade.tachiyomi.core.preference.getAndSet +import tachiyomi.core.preference.getAndSet class ToggleLanguage( val preferences: SourcePreferences, diff --git a/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSource.kt b/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSource.kt index 9eb0ab8e6d..fbcb3147c3 100644 --- a/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSource.kt +++ b/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSource.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.interactor import eu.kanade.domain.source.service.SourcePreferences -import eu.kanade.tachiyomi.core.preference.getAndSet +import tachiyomi.core.preference.getAndSet import tachiyomi.domain.source.model.Source class ToggleSource( diff --git a/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSourcePin.kt b/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSourcePin.kt index 532ce669ce..e7ea8bb351 100644 --- a/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSourcePin.kt +++ b/app/src/main/java/eu/kanade/domain/source/interactor/ToggleSourcePin.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.source.interactor import eu.kanade.domain.source.service.SourcePreferences -import eu.kanade.tachiyomi.core.preference.getAndSet +import tachiyomi.core.preference.getAndSet import tachiyomi.domain.source.model.Source class ToggleSourcePin( 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 db9e01eccb..626c56544f 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 @@ -1,9 +1,9 @@ package eu.kanade.domain.source.service import eu.kanade.domain.source.interactor.SetMigrateSorting -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.preference.getEnum import eu.kanade.tachiyomi.util.system.LocaleHelper +import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.preference.getEnum import tachiyomi.domain.library.model.LibraryDisplayMode class SourcePreferences( diff --git a/app/src/main/java/eu/kanade/domain/track/interactor/DeleteTrack.kt b/app/src/main/java/eu/kanade/domain/track/interactor/DeleteTrack.kt index 970dc864e2..361658167b 100644 --- a/app/src/main/java/eu/kanade/domain/track/interactor/DeleteTrack.kt +++ b/app/src/main/java/eu/kanade/domain/track/interactor/DeleteTrack.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.track.interactor -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.track.repository.TrackRepository class DeleteTrack( diff --git a/app/src/main/java/eu/kanade/domain/track/interactor/GetTracks.kt b/app/src/main/java/eu/kanade/domain/track/interactor/GetTracks.kt index f02c962668..c611b9f507 100644 --- a/app/src/main/java/eu/kanade/domain/track/interactor/GetTracks.kt +++ b/app/src/main/java/eu/kanade/domain/track/interactor/GetTracks.kt @@ -1,8 +1,8 @@ package eu.kanade.domain.track.interactor -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.flow.Flow import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.track.model.Track import tachiyomi.domain.track.repository.TrackRepository diff --git a/app/src/main/java/eu/kanade/domain/track/interactor/InsertTrack.kt b/app/src/main/java/eu/kanade/domain/track/interactor/InsertTrack.kt index 3da31e58f0..7542cc866d 100644 --- a/app/src/main/java/eu/kanade/domain/track/interactor/InsertTrack.kt +++ b/app/src/main/java/eu/kanade/domain/track/interactor/InsertTrack.kt @@ -1,7 +1,7 @@ package eu.kanade.domain.track.interactor -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.track.model.Track import tachiyomi.domain.track.repository.TrackRepository diff --git a/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt b/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt index 952d2493ca..46703440a4 100644 --- a/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt +++ b/app/src/main/java/eu/kanade/domain/track/service/DelayedTrackingUpdateJob.kt @@ -14,9 +14,9 @@ import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.store.DelayedTrackingStore import eu.kanade.tachiyomi.data.track.TrackManager -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/eu/kanade/domain/track/service/TrackPreferences.kt b/app/src/main/java/eu/kanade/domain/track/service/TrackPreferences.kt index e14392e542..2ddba51e09 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 @@ -1,8 +1,8 @@ package eu.kanade.domain.track.service -import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.anilist.Anilist +import tachiyomi.core.preference.PreferenceStore class TrackPreferences( private val preferenceStore: PreferenceStore, diff --git a/app/src/main/java/eu/kanade/domain/track/store/DelayedTrackingStore.kt b/app/src/main/java/eu/kanade/domain/track/store/DelayedTrackingStore.kt index 4d346706c4..d7fc6fa105 100644 --- a/app/src/main/java/eu/kanade/domain/track/store/DelayedTrackingStore.kt +++ b/app/src/main/java/eu/kanade/domain/track/store/DelayedTrackingStore.kt @@ -2,8 +2,8 @@ package eu.kanade.domain.track.store import android.content.Context import androidx.core.content.edit -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.track.model.Track class DelayedTrackingStore(context: Context) { 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 9a7577feec..5de3e963ae 100644 --- a/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt +++ b/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt @@ -4,10 +4,10 @@ import android.os.Build import eu.kanade.domain.ui.model.AppTheme import eu.kanade.domain.ui.model.TabletUiMode import eu.kanade.domain.ui.model.ThemeMode -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.preference.getEnum 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 java.util.Locale diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt index 5f5c703adc..862ecb93e2 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt @@ -32,7 +32,7 @@ import eu.kanade.presentation.util.rememberResourceBitmapPainter import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.source.LocalSource -import eu.kanade.tachiyomi.util.lang.withIOContext +import tachiyomi.core.util.lang.withIOContext import tachiyomi.domain.source.model.Source private val defaultModifier = Modifier diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceItem.kt b/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceItem.kt index 13fe26a2bc..f9d76535ee 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceItem.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceItem.kt @@ -22,8 +22,8 @@ import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget import eu.kanade.presentation.more.settings.widget.TrackingPreferenceWidget import eu.kanade.presentation.util.collectAsState -import eu.kanade.tachiyomi.core.preference.PreferenceStore import kotlinx.coroutines.launch +import tachiyomi.core.preference.PreferenceStore import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceModel.kt b/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceModel.kt index 16e5e518e4..b5672f37cf 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceModel.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/PreferenceModel.kt @@ -7,7 +7,7 @@ import androidx.compose.ui.res.stringResource import eu.kanade.domain.ui.model.AppTheme import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.TrackService -import eu.kanade.tachiyomi.core.preference.Preference as PreferenceData +import tachiyomi.core.preference.Preference as PreferenceData sealed class Preference { abstract val title: String diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt index 01f763afd2..931603ef2d 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/AboutScreen.kt @@ -35,13 +35,13 @@ import eu.kanade.tachiyomi.data.updater.RELEASE_URL import eu.kanade.tachiyomi.ui.more.NewUpdateScreen import eu.kanade.tachiyomi.util.CrashLogUtil import eu.kanade.tachiyomi.util.lang.toDateTimestampString -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.system.copyToClipboard -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.launch import logcat.LogPriority +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.text.DateFormat diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt index bb67ae5f7a..c3ede3a409 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/ClearDatabaseScreen.kt @@ -45,12 +45,12 @@ import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.util.selectedBackground import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchUI -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.update +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.util.lang.launchUI +import tachiyomi.core.util.lang.withNonCancellableContext import tachiyomi.data.Database import tachiyomi.domain.source.model.Source import tachiyomi.domain.source.model.SourceWithCount 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 2b57ecfc52..1ddc04c91d 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 @@ -49,18 +49,18 @@ import eu.kanade.tachiyomi.network.PREF_DOH_QUAD101 import eu.kanade.tachiyomi.network.PREF_DOH_QUAD9 import eu.kanade.tachiyomi.network.PREF_DOH_SHECAN import eu.kanade.tachiyomi.util.CrashLogUtil -import eu.kanade.tachiyomi.util.lang.launchNonCancellable -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.system.isPreviewBuildType import eu.kanade.tachiyomi.util.system.isReleaseBuildType import eu.kanade.tachiyomi.util.system.isShizukuInstalled -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.powerManager import eu.kanade.tachiyomi.util.system.setDefaultSettings import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.launch import logcat.LogPriority import okhttp3.Headers +import tachiyomi.core.util.lang.launchNonCancellable +import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.repository.MangaRepository import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get 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 2962c9087d..582b6efa0a 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 @@ -53,10 +53,10 @@ import eu.kanade.tachiyomi.data.track.bangumi.BangumiApi import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeListApi import eu.kanade.tachiyomi.data.track.shikimori.ShikimoriApi import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toast +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.util.lang.withUIContext import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/presentation/util/Preference.kt b/app/src/main/java/eu/kanade/presentation/util/Preference.kt index 73888ed07f..4b67009c63 100644 --- a/app/src/main/java/eu/kanade/presentation/util/Preference.kt +++ b/app/src/main/java/eu/kanade/presentation/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 eu.kanade.tachiyomi.core.preference.Preference +import tachiyomi.core.preference.Preference @Composable fun Preference.collectAsState(): State { diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index dbb3e6ec72..ae018c2ec3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -42,7 +42,6 @@ import eu.kanade.tachiyomi.util.system.WebViewUtil import eu.kanade.tachiyomi.util.system.animatorDurationScale import eu.kanade.tachiyomi.util.system.isPreviewBuildType import eu.kanade.tachiyomi.util.system.isReleaseBuildType -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.notification import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.launchIn @@ -54,6 +53,7 @@ import org.acra.config.httpSender import org.acra.ktx.initAcra import org.acra.sender.HttpSender import org.conscrypt.Conscrypt +import tachiyomi.core.util.system.logcat import tachiyomi.presentation.widget.TachiyomiWidgetManager import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt b/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt index 707349229e..fac18baf2d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/AppModule.kt @@ -15,10 +15,6 @@ import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.track.service.TrackPreferences import eu.kanade.domain.track.store.DelayedTrackingStore import eu.kanade.domain.ui.UiPreferences -import eu.kanade.tachiyomi.core.preference.AndroidPreferenceStore -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.provider.AndroidBackupFolderProvider -import eu.kanade.tachiyomi.core.provider.AndroidDownloadFolderProvider import eu.kanade.tachiyomi.core.security.SecurityPreferences import eu.kanade.tachiyomi.data.cache.ChapterCache import eu.kanade.tachiyomi.data.cache.CoverCache @@ -40,6 +36,10 @@ import nl.adaptivity.xmlutil.XmlDeclMode import nl.adaptivity.xmlutil.core.XmlVersion import nl.adaptivity.xmlutil.serialization.UnknownChildHandler import nl.adaptivity.xmlutil.serialization.XML +import tachiyomi.core.preference.AndroidPreferenceStore +import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.provider.AndroidBackupFolderProvider +import tachiyomi.core.provider.AndroidDownloadFolderProvider import tachiyomi.data.AndroidDatabaseHandler import tachiyomi.data.Database import tachiyomi.data.DatabaseHandler diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 002c80ac52..cd8f088f15 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -9,7 +9,6 @@ import eu.kanade.domain.base.BasePreferences import eu.kanade.domain.library.service.LibraryPreferences import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.ui.UiPreferences -import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.core.security.SecurityPreferences import eu.kanade.tachiyomi.data.backup.BackupCreatorJob import eu.kanade.tachiyomi.data.library.LibraryUpdateJob @@ -27,6 +26,7 @@ import eu.kanade.tachiyomi.util.preference.plusAssign import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.widget.ExtendedNavigationView +import tachiyomi.core.preference.PreferenceStore 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/crash/GlobalExceptionHandler.kt b/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt index 6684700717..ae75363816 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/crash/GlobalExceptionHandler.kt @@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.crash import android.content.Context import android.content.Intent -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.serialization.KSerializer import kotlinx.serialization.descriptors.PrimitiveKind import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor @@ -11,6 +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 kotlin.system.exitProcess class GlobalExceptionHandler private constructor( diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt index 2a5aec38e4..136a5de2ab 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt @@ -16,9 +16,9 @@ import androidx.work.workDataOf import com.hippo.unifile.UniFile import eu.kanade.domain.backup.service.BackupPreferences import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.notificationManager import logcat.LogPriority +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt index f2ff2e0d69..375528a3ca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupManager.kt @@ -32,13 +32,13 @@ import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.copyFrom import eu.kanade.tachiyomi.util.system.hasPermission -import eu.kanade.tachiyomi.util.system.logcat -import eu.kanade.tachiyomi.util.toLong import kotlinx.serialization.protobuf.ProtoBuf import logcat.LogPriority import okio.buffer import okio.gzip import okio.sink +import tachiyomi.core.util.lang.toLong +import tachiyomi.core.util.system.logcat import tachiyomi.data.DatabaseHandler import tachiyomi.data.Manga_sync import tachiyomi.data.Mangas diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt index a9615e7bf1..04be1f0698 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestoreService.kt @@ -12,7 +12,6 @@ import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.getParcelableExtraCompat import eu.kanade.tachiyomi.util.system.isServiceRunning -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -20,6 +19,7 @@ import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import logcat.LogPriority +import tachiyomi.core.util.system.logcat /** * Restores backup. 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 f5225bfc2d..e36ebd2ecd 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 @@ -16,7 +16,6 @@ import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.network.await import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.HttpSource -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority import okhttp3.CacheControl import okhttp3.Call @@ -27,6 +26,7 @@ import okio.Path.Companion.toOkioPath import okio.Source import okio.buffer import okio.sink +import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.model.MangaCover import uy.kohesive.injekt.injectLazy import java.io.File diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt index 623f8ebb3d..6b7dd9b6ce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt @@ -8,9 +8,6 @@ import eu.kanade.domain.download.service.DownloadPreferences import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchNonCancellable -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -30,6 +27,9 @@ import kotlinx.coroutines.flow.shareIn import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.withTimeoutOrNull import logcat.LogPriority +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.util.lang.launchNonCancellable +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt index 96164a32f2..6cca2074ea 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt @@ -9,10 +9,10 @@ import eu.kanade.tachiyomi.data.download.model.DownloadQueue import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.Page -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.runBlocking import logcat.LogPriority +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt index 59864f4a46..581bf2a898 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt @@ -7,11 +7,11 @@ import eu.kanade.domain.download.service.DownloadPreferences import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.util.storage.DiskUtil -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.MainScope import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt index 62d90e7da4..3c4e7c10f8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadService.kt @@ -11,12 +11,10 @@ import androidx.core.content.ContextCompat import eu.kanade.domain.download.service.DownloadPreferences import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.isConnectedToWifi import eu.kanade.tachiyomi.util.system.isOnline import eu.kanade.tachiyomi.util.system.isServiceRunning -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.notification import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.CoroutineScope @@ -30,6 +28,8 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import logcat.LogPriority import ru.beryukhov.reactivenetwork.ReactiveNetwork +import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.injectLazy /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt index 98fc4fff20..9f350b7dd1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt @@ -20,15 +20,11 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList import eu.kanade.tachiyomi.util.lang.RetryWithDelay -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchNow import eu.kanade.tachiyomi.util.lang.plusAssign -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.DiskUtil.NOMEDIA_FILE import eu.kanade.tachiyomi.util.storage.saveTo import eu.kanade.tachiyomi.util.system.ImageUtil -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.async import logcat.LogPriority import nl.adaptivity.xmlutil.serialization.XML @@ -37,6 +33,10 @@ import rx.Observable import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers import rx.subscriptions.CompositeSubscription +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.util.lang.launchNow +import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/model/DownloadQueue.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/model/DownloadQueue.kt index 7b3867a7bf..f3d79c63a7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/model/DownloadQueue.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/model/DownloadQueue.kt @@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.download.model import eu.kanade.core.util.asFlow import eu.kanade.tachiyomi.data.download.DownloadStore import eu.kanade.tachiyomi.source.model.Page -import eu.kanade.tachiyomi.util.lang.launchNonCancellable import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel @@ -15,6 +14,7 @@ import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.shareIn import rx.Observable import rx.subjects.PublishSubject +import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga import java.util.concurrent.CopyOnWriteArrayList diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt index 78269db552..9a989fdb61 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt @@ -21,11 +21,11 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.util.lang.chop -import eu.kanade.tachiyomi.util.lang.launchUI import eu.kanade.tachiyomi.util.system.notification import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notificationManager import tachiyomi.core.Constants +import tachiyomi.core.util.lang.launchUI import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt index b73e6a641f..77d10cc534 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt @@ -22,7 +22,6 @@ import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.model.toDomainTrack import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.core.preference.getAndSet import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.data.download.DownloadService @@ -38,7 +37,6 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.UnmeteredSource import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.UpdateStrategy -import eu.kanade.tachiyomi.util.lang.withIOContext import eu.kanade.tachiyomi.util.prepUpdateCover import eu.kanade.tachiyomi.util.shouldDownloadNewChapters import eu.kanade.tachiyomi.util.storage.getUriCompat @@ -46,7 +44,6 @@ import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.createFileInCacheDir import eu.kanade.tachiyomi.util.system.getSerializableExtraCompat import eu.kanade.tachiyomi.util.system.isServiceRunning -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -61,6 +58,9 @@ import kotlinx.coroutines.supervisorScope import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.withPermit import logcat.LogPriority +import tachiyomi.core.preference.getAndSet +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.Category import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.NoChaptersException 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 e9c0e6a8e8..d471938c19 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 @@ -21,7 +21,6 @@ import eu.kanade.tachiyomi.data.updater.AppUpdateService import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.system.getParcelableExtraCompat @@ -30,6 +29,7 @@ import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.runBlocking import tachiyomi.core.Constants +import tachiyomi.core.util.lang.launchIO import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.toChapterUpdate import tachiyomi.domain.manga.model.Manga 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 06457f0bc0..b8a2befab2 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 @@ -16,9 +16,9 @@ import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.cacheImageDir import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.system.ImageUtil -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority import okio.IOException +import tachiyomi.core.util.system.logcat import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream import java.io.File diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt index 27f81f80a7..0d33de384f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt @@ -15,12 +15,12 @@ import eu.kanade.domain.track.service.TrackPreferences import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.network.NetworkHelper -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withUIContext -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toast import logcat.LogPriority import okhttp3.OkHttpClient +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.util.system.logcat 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/track/anilist/AnilistApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistApi.kt index 5d68507590..0cbd72c170 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 @@ -9,7 +9,6 @@ import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.network.jsonMime import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext import kotlinx.serialization.json.JsonNull import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.buildJsonObject @@ -24,6 +23,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 java.util.Calendar import java.util.concurrent.TimeUnit 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 e14210c77d..6d10b9d2c7 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 @@ -9,7 +9,6 @@ import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonObject @@ -23,6 +22,7 @@ import okhttp3.CacheControl import okhttp3.FormBody import okhttp3.OkHttpClient import okhttp3.Request +import tachiyomi.core.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/kavita/KavitaApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kavita/KavitaApi.kt index 210074c8ea..f58b705f9c 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 @@ -6,13 +6,13 @@ import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority 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 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 3472a95660..917c50a56d 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 @@ -8,7 +8,6 @@ import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.jsonMime import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.buildJsonObject import kotlinx.serialization.json.jsonArray @@ -24,6 +23,7 @@ import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody +import tachiyomi.core.util.lang.withIOContext 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 52c1bac53b..149d2903ba 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 @@ -6,8 +6,6 @@ import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import logcat.LogPriority @@ -15,6 +13,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 uy.kohesive.injekt.injectLazy 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 50a88011aa..929bd1b864 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 @@ -13,7 +13,6 @@ import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.PUT import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.serialization.json.Json import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.add @@ -29,6 +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 uy.kohesive.injekt.injectLazy class MangaUpdatesApi( 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 9cbeb2b2fb..51c4113576 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 @@ -10,7 +10,6 @@ import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs import eu.kanade.tachiyomi.util.PkceUtil -import eu.kanade.tachiyomi.util.lang.withIOContext import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.serialization.json.JsonObject @@ -27,6 +26,7 @@ import okhttp3.Headers import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody +import tachiyomi.core.util.lang.withIOContext import java.text.SimpleDateFormat import java.util.Locale 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 7cbde2e4dc..2d16a10dc4 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 @@ -9,7 +9,6 @@ import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.jsonMime import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext import kotlinx.serialization.json.JsonArray import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.buildJsonObject @@ -24,6 +23,7 @@ import kotlinx.serialization.json.putJsonObject import okhttp3.FormBody import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody +import tachiyomi.core.util.lang.withIOContext class ShikimoriApi(private val client: OkHttpClient, interceptor: ShikimoriInterceptor) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt index edc6d7e608..4107cd8046 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/suwayomi/TachideskApi.kt @@ -10,12 +10,12 @@ import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.network.PUT import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext import okhttp3.Credentials import okhttp3.Dns import okhttp3.FormBody import okhttp3.Headers import okhttp3.OkHttpClient +import tachiyomi.core.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 617529d7e1..0cd1576214 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 @@ -2,14 +2,14 @@ package eu.kanade.tachiyomi.data.updater import android.content.Context import eu.kanade.tachiyomi.BuildConfig -import eu.kanade.tachiyomi.core.preference.Preference -import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext import eu.kanade.tachiyomi.util.system.isInstalledFromFDroid +import tachiyomi.core.preference.Preference +import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.util.lang.withIOContext import uy.kohesive.injekt.injectLazy import java.util.Date import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateJob.kt index 602c173ec9..776061ca89 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateJob.kt @@ -9,9 +9,9 @@ import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager import androidx.work.WorkerParameters import eu.kanade.tachiyomi.BuildConfig -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.coroutineScope import logcat.LogPriority +import tachiyomi.core.util.system.logcat import java.util.concurrent.TimeUnit class AppUpdateJob(private val context: Context, workerParams: WorkerParameters) : diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateService.kt index ad1f5d557c..d67dab7be6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateService.kt @@ -15,18 +15,18 @@ import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.network.ProgressListener import eu.kanade.tachiyomi.network.await import eu.kanade.tachiyomi.network.newCachelessCallWithProgress -import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.storage.saveTo import eu.kanade.tachiyomi.util.system.acquireWakeLock import eu.kanade.tachiyomi.util.system.isServiceRunning -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Job import logcat.LogPriority import okhttp3.Call import okhttp3.internal.http2.ErrorCode import okhttp3.internal.http2.StreamResetException +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.injectLazy import java.io.File diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt index 1fb87e79f4..b5f4d45c14 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionManager.kt @@ -12,16 +12,16 @@ import eu.kanade.tachiyomi.extension.model.LoadResult import eu.kanade.tachiyomi.extension.util.ExtensionInstallReceiver import eu.kanade.tachiyomi.extension.util.ExtensionInstaller import eu.kanade.tachiyomi.extension.util.ExtensionLoader -import eu.kanade.tachiyomi.util.lang.launchNow -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.preference.plusAssign -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.async import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import logcat.LogPriority import rx.Observable +import tachiyomi.core.util.lang.launchNow +import tachiyomi.core.util.lang.withUIContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.source.model.SourceData import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt index f0a02954f8..6713ad712e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt @@ -15,10 +15,10 @@ import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.extension.api.ExtensionGithubApi -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.notification import kotlinx.coroutines.coroutineScope import logcat.LogPriority +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index 3ef6a99e6d..d83d53bfa3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -1,8 +1,6 @@ package eu.kanade.tachiyomi.extension.api import android.content.Context -import eu.kanade.tachiyomi.core.preference.Preference -import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.extension.model.AvailableSources import eu.kanade.tachiyomi.extension.model.Extension @@ -12,10 +10,12 @@ import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.network.awaitSuccess import eu.kanade.tachiyomi.network.parseAs -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.serialization.Serializable 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 uy.kohesive.injekt.injectLazy import java.util.Date import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt index c8ee92aab7..0b6b3e7242 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/PackageInstallerInstaller.kt @@ -12,8 +12,8 @@ import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.util.lang.use import eu.kanade.tachiyomi.util.system.getParcelableExtraCompat import eu.kanade.tachiyomi.util.system.getUriSize -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat class PackageInstallerInstaller(private val service: Service) : Installer(service) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt index 68311c1fbe..cf03f3f371 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt @@ -6,7 +6,6 @@ import android.os.Build import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.util.system.getUriSize -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -15,6 +14,7 @@ import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import logcat.LogPriority import rikka.shizuku.Shizuku +import tachiyomi.core.util.system.logcat import java.io.BufferedReader import java.io.InputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt index 76c276dacd..80d240ee0c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt @@ -6,13 +6,13 @@ import android.content.Intent import android.content.IntentFilter import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.LoadResult -import eu.kanade.tachiyomi.util.lang.launchNow -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.CoroutineStart 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 /** * 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/util/ExtensionInstallService.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallService.kt index 8a787b548c..45368c2b42 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallService.kt @@ -13,9 +13,9 @@ import eu.kanade.tachiyomi.extension.installer.PackageInstallerInstaller import eu.kanade.tachiyomi.extension.installer.ShizukuInstaller import eu.kanade.tachiyomi.extension.util.ExtensionInstaller.Companion.EXTRA_DOWNLOAD_ID import eu.kanade.tachiyomi.util.system.getSerializableExtraCompat -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.notificationBuilder import logcat.LogPriority +import tachiyomi.core.util.system.logcat class ExtensionInstallService : Service() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt index 0e7bb0c37f..c63d6bf2f4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstaller.kt @@ -17,10 +17,10 @@ import eu.kanade.tachiyomi.extension.installer.Installer import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.util.storage.getUriCompat -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority import rx.Observable import rx.android.schedulers.AndroidSchedulers +import tachiyomi.core.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/util/ExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt index 8fcbc88c90..7ecb4bd528 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt @@ -15,10 +15,10 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.util.lang.Hash import eu.kanade.tachiyomi.util.system.getApplicationIcon -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import logcat.LogPriority +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.injectLazy /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt index b1a48e6f7a..03ad7c22a2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt @@ -14,11 +14,9 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.util.chapter.ChapterRecognition import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder -import eu.kanade.tachiyomi.util.lang.withIOContext import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.EpubFile import eu.kanade.tachiyomi.util.system.ImageUtil -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.runBlocking import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json @@ -27,6 +25,8 @@ import logcat.LogPriority import nl.adaptivity.xmlutil.AndroidXmlReader import nl.adaptivity.xmlutil.serialization.XML import rx.Observable +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.injectLazy import java.io.File import java.io.FileInputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionFilterScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionFilterScreenModel.kt index d5a93bd76a..d77ed39205 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionFilterScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionFilterScreenModel.kt @@ -6,7 +6,6 @@ import cafe.adriel.voyager.core.model.coroutineScope import eu.kanade.domain.extension.interactor.GetExtensionLanguages import eu.kanade.domain.source.interactor.ToggleLanguage import eu.kanade.domain.source.service.SourcePreferences -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch @@ -16,6 +15,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 uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsScreenModel.kt index 560aaf1196..f701cb27df 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsScreenModel.kt @@ -12,7 +12,6 @@ import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.source.online.HttpSource -import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.system.LocaleHelper import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow @@ -25,6 +24,7 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update import rx.Observable +import tachiyomi.core.util.lang.launchIO import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import kotlin.time.Duration.Companion.seconds diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt index fc2109d2ba..1cdf9c16dc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/ExtensionDetailsScreenModel.kt @@ -12,7 +12,6 @@ import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.util.system.LocaleHelper -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch @@ -23,6 +22,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 uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt index 7f473c1d01..a7cd49bd12 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/manga/MigrationMangaScreenModel.kt @@ -6,7 +6,6 @@ import cafe.adriel.voyager.core.model.coroutineScope import eu.kanade.domain.manga.interactor.GetFavorites import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch @@ -16,6 +15,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.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt index ae5a5e484e..2da62f722b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt @@ -37,8 +37,6 @@ import eu.kanade.domain.track.interactor.GetTracks import eu.kanade.domain.track.interactor.InsertTrack import eu.kanade.presentation.components.LoadingScreen import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.core.preference.Preference -import eu.kanade.tachiyomi.core.preference.PreferenceStore import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.track.EnhancedTrackService import eu.kanade.tachiyomi.data.track.TrackManager @@ -46,9 +44,11 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.ui.browse.migration.MigrationFlags -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.withUIContext 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.domain.chapter.model.toChapterUpdate import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.MangaUpdate diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrateSourceScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrateSourceScreenModel.kt index eee8c1a434..b9445b4602 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrateSourceScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrateSourceScreenModel.kt @@ -5,8 +5,6 @@ import cafe.adriel.voyager.core.model.coroutineScope import eu.kanade.domain.source.interactor.GetSourcesWithFavoriteCount import eu.kanade.domain.source.interactor.SetMigrateSorting import eu.kanade.domain.source.service.SourcePreferences -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.collectLatest @@ -15,6 +13,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.domain.source.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/source/SourcesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt index e571e2390c..c1cac99d23 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesScreenModel.kt @@ -9,14 +9,14 @@ import eu.kanade.domain.source.interactor.ToggleSource import eu.kanade.domain.source.interactor.ToggleSourcePin import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.presentation.browse.SourceUiModel -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.catch 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.domain.source.model.Pin import tachiyomi.domain.source.model.Source import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt index c3d5e73a62..aa5aa3bc99 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreen.kt @@ -54,11 +54,11 @@ import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceScreenModel.Listi import eu.kanade.tachiyomi.ui.category.CategoryScreen import eu.kanade.tachiyomi.ui.manga.MangaScreen import eu.kanade.tachiyomi.ui.webview.WebViewScreen -import eu.kanade.tachiyomi.util.lang.launchIO import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import tachiyomi.core.Constants +import tachiyomi.core.util.lang.launchIO data class BrowseSourceScreen( private val sourceId: Long, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt index 92c5157377..74bbe2a321 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt @@ -54,11 +54,7 @@ import eu.kanade.tachiyomi.ui.browse.source.filter.TextItem import eu.kanade.tachiyomi.ui.browse.source.filter.TextSectionItem import eu.kanade.tachiyomi.ui.browse.source.filter.TriStateItem import eu.kanade.tachiyomi.ui.browse.source.filter.TriStateSectionItem -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext import eu.kanade.tachiyomi.util.removeCovers -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.emptyFlow @@ -70,6 +66,10 @@ import kotlinx.coroutines.flow.stateIn 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.lang.withNonCancellableContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.Category import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.toMangaUpdate diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt index c91e6599f7..37977f3296 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/SearchScreenModel.kt @@ -14,10 +14,6 @@ import eu.kanade.domain.manga.model.toSManga import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.tachiyomi.extension.ExtensionManager import eu.kanade.tachiyomi.source.CatalogueSource -import eu.kanade.tachiyomi.util.lang.awaitSingle -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll @@ -25,6 +21,10 @@ import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import logcat.LogPriority +import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.toMangaUpdate import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt index 37584ee4e6..003a85c018 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreen.kt @@ -58,7 +58,7 @@ import eu.kanade.presentation.components.Scaffold import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.download.DownloadService import eu.kanade.tachiyomi.databinding.DownloadListBinding -import eu.kanade.tachiyomi.util.lang.launchUI +import tachiyomi.core.util.lang.launchUI import kotlin.math.roundToInt object DownloadQueueScreen : Screen { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt index 8f5ef2a983..b14f310857 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt @@ -10,7 +10,6 @@ import eu.kanade.tachiyomi.data.download.DownloadService import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.databinding.DownloadListBinding import eu.kanade.tachiyomi.source.model.Page -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow @@ -24,6 +23,7 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority +import tachiyomi.core.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/history/HistoryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/history/HistoryScreenModel.kt index f2ddb2610e..8a935d8641 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/history/HistoryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/history/HistoryScreenModel.kt @@ -8,10 +8,7 @@ import eu.kanade.domain.history.interactor.GetHistory import eu.kanade.domain.history.interactor.GetNextChapters import eu.kanade.domain.history.interactor.RemoveHistory import eu.kanade.presentation.history.HistoryUiModel -import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.lang.toDateKey -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow @@ -24,6 +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.domain.chapter.model.Chapter import tachiyomi.domain.history.model.HistoryWithRelations import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt index cb774d0ae9..f8f75f930d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryScreenModel.kt @@ -37,9 +37,6 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.util.chapter.getNextUnread -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchNonCancellable -import eu.kanade.tachiyomi.util.lang.withIOContext import eu.kanade.tachiyomi.util.removeCovers import eu.kanade.tachiyomi.widget.ExtendedNavigationView.Item.TriStateGroup import kotlinx.coroutines.flow.Flow @@ -53,6 +50,9 @@ import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.update +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.util.lang.launchNonCancellable +import tachiyomi.core.util.lang.withIOContext import tachiyomi.domain.category.model.Category import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.library.model.LibraryManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt index 8049fe4bf4..b642ce9021 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt @@ -11,13 +11,13 @@ import eu.kanade.domain.library.service.LibraryPreferences import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackService -import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.widget.ExtendedNavigationView import eu.kanade.tachiyomi.widget.ExtendedNavigationView.Item.TriStateGroup.State import eu.kanade.tachiyomi.widget.sheet.TabbedBottomSheetDialog import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job +import tachiyomi.core.util.lang.launchIO import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.library.model.LibrarySort diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt index 2e12c1fbe1..6aa817b9d0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt @@ -48,11 +48,11 @@ import eu.kanade.tachiyomi.ui.home.HomeScreen import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.manga.MangaScreen import eu.kanade.tachiyomi.ui.reader.ReaderActivity -import eu.kanade.tachiyomi.util.lang.launchIO import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch +import tachiyomi.core.util.lang.launchIO import tachiyomi.domain.category.model.Category import tachiyomi.domain.library.model.LibraryManga import tachiyomi.domain.library.model.display 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 30c1bfc3d7..dd81afa57e 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 @@ -81,7 +81,6 @@ import eu.kanade.tachiyomi.ui.manga.MangaScreen import eu.kanade.tachiyomi.ui.more.NewUpdateScreen import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.isNavigationBarNeedsScrim -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.view.setComposeContent @@ -94,6 +93,7 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch import logcat.LogPriority import tachiyomi.core.Constants +import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.Category import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt index c50ba7d384..c80314b6c1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaCoverScreenModel.kt @@ -17,14 +17,14 @@ import eu.kanade.tachiyomi.data.saver.Image import eu.kanade.tachiyomi.data.saver.ImageSaver import eu.kanade.tachiyomi.data.saver.Location import eu.kanade.tachiyomi.util.editCover -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withUIContext -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toShareIntent 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.lang.withUIContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.model.Manga import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt index ca06542916..570f8b90db 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreen.kt @@ -48,13 +48,13 @@ import eu.kanade.tachiyomi.ui.home.HomeScreen import eu.kanade.tachiyomi.ui.manga.track.TrackInfoDialogHomeScreen import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.ui.webview.WebViewScreen -import eu.kanade.tachiyomi.util.lang.withIOContext import eu.kanade.tachiyomi.util.system.copyToClipboard -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.launch import logcat.LogPriority +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.manga.model.Manga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt index 91cd483cea..e8682d11b3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt @@ -47,13 +47,8 @@ import eu.kanade.tachiyomi.ui.manga.track.TrackItem import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.util.chapter.getChapterSort import eu.kanade.tachiyomi.util.chapter.getNextUnread -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchNonCancellable -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.removeCovers import eu.kanade.tachiyomi.util.shouldDownloadNewChapters -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.flow.catch @@ -66,6 +61,11 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.isActive import kotlinx.coroutines.launch 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.lang.withUIContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.category.model.Category import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.ChapterUpdate diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt index 5ff5c0af57..efde7fa62e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt @@ -60,10 +60,6 @@ import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.lang.launchNonCancellable -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withUIContext -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toast import kotlinx.coroutines.flow.catch @@ -73,6 +69,10 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import logcat.LogPriority +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 uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import java.time.Instant diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt index d7774f8be1..77412f5424 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 @@ -28,13 +28,13 @@ import eu.kanade.tachiyomi.ui.category.CategoryScreen import eu.kanade.tachiyomi.ui.download.DownloadQueueScreen import eu.kanade.tachiyomi.ui.setting.SettingsScreen import eu.kanade.tachiyomi.ui.stats.StatsScreen -import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.system.isInstalledFromFDroid import kotlinx.coroutines.flow.MutableStateFlow 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 uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get 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 127f90af26..1fcf8a0fe1 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 @@ -67,16 +67,12 @@ import eu.kanade.tachiyomi.ui.reader.viewer.BaseViewer import eu.kanade.tachiyomi.ui.reader.viewer.ReaderProgressIndicator import eu.kanade.tachiyomi.ui.reader.viewer.pager.R2LPagerViewer import eu.kanade.tachiyomi.ui.webview.WebViewActivity -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchNonCancellable -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.preference.toggle import eu.kanade.tachiyomi.util.system.applySystemAnimatorScale import eu.kanade.tachiyomi.util.system.createReaderThemeContext import eu.kanade.tachiyomi.util.system.getThemeColor import eu.kanade.tachiyomi.util.system.hasDisplayCutout import eu.kanade.tachiyomi.util.system.isNightMode -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.view.copy @@ -94,6 +90,10 @@ import kotlinx.coroutines.flow.sample import kotlinx.coroutines.launch import logcat.LogPriority import tachiyomi.core.Constants +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.domain.manga.model.Manga import uy.kohesive.injekt.injectLazy import kotlin.math.abs 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 01f1af3cd7..ee164e2378 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 @@ -49,15 +49,10 @@ import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType import eu.kanade.tachiyomi.util.chapter.getChapterSort import eu.kanade.tachiyomi.util.editCover import eu.kanade.tachiyomi.util.lang.byteSize -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchNonCancellable import eu.kanade.tachiyomi.util.lang.takeBytes -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.cacheImageDir import eu.kanade.tachiyomi.util.system.isOnline -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async @@ -75,6 +70,11 @@ import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch 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.lang.withUIContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.chapter.model.ChapterUpdate import tachiyomi.domain.history.model.HistoryUpdate import tachiyomi.domain.manga.model.Manga 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 c5d7028736..4a863d862a 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 @@ -10,8 +10,8 @@ import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter -import eu.kanade.tachiyomi.util.lang.withIOContext -import eu.kanade.tachiyomi.util.system.logcat +import tachiyomi.core.util.lang.withIOContext +import tachiyomi.core.util.system.logcat import tachiyomi.domain.manga.model.Manga /** 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 780d21bf78..55bf83f3a5 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 @@ -6,9 +6,6 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.model.ReaderPage -import eu.kanade.tachiyomi.util.lang.awaitSingle -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.withIOContext import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -18,6 +15,9 @@ import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.flow import kotlinx.coroutines.runInterruptible import kotlinx.coroutines.suspendCancellableCoroutine +import tachiyomi.core.util.lang.awaitSingle +import tachiyomi.core.util.lang.launchIO +import tachiyomi.core.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/model/ReaderChapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt index fe216f9acb..ff1fb23c41 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 @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.ui.reader.model import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.ui.reader.loader.PageLoader -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.flow.MutableStateFlow +import tachiyomi.core.util.system.logcat data class ReaderChapter(val chapter: Chapter) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt index 8d83c97f25..2695ce198b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderColorFilterSettings.kt @@ -10,13 +10,13 @@ import androidx.core.graphics.green import androidx.core.graphics.red import androidx.core.widget.NestedScrollView import androidx.lifecycle.lifecycleScope -import eu.kanade.tachiyomi.core.preference.getAndSet import eu.kanade.tachiyomi.databinding.ReaderColorFilterSettingsBinding import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.util.preference.bindToPreference import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.sample +import tachiyomi.core.preference.getAndSet import uy.kohesive.injekt.injectLazy /** 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 a80295ddc5..d45ba7d96c 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 @@ -1,9 +1,9 @@ package eu.kanade.tachiyomi.ui.reader.setting -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.preference.getEnum import eu.kanade.tachiyomi.data.preference.PreferenceValues import eu.kanade.tachiyomi.util.system.isReleaseBuildType +import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.preference.getEnum class ReaderPreferences( private val preferenceStore: PreferenceStore, 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 cc2bd82977..7c9279746a 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 @@ -1,12 +1,12 @@ package eu.kanade.tachiyomi.ui.reader.viewer -import eu.kanade.tachiyomi.core.preference.Preference import eu.kanade.tachiyomi.data.preference.PreferenceValues.TappingInvertMode import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach +import tachiyomi.core.preference.Preference /** * Common configuration for all viewers. 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 13b1979708..94e8de16f4 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 @@ -19,9 +19,9 @@ import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters import eu.kanade.tachiyomi.ui.reader.viewer.BaseViewer import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation.NavigationRegion -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.MainScope import kotlinx.coroutines.cancel +import tachiyomi.core.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 1c7443e57d..59c5fb52bd 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 @@ -9,8 +9,8 @@ import eu.kanade.tachiyomi.ui.reader.model.ReaderPage import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters import eu.kanade.tachiyomi.ui.reader.viewer.hasMissingChapters import eu.kanade.tachiyomi.util.system.createReaderThemeContext -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.widget.ViewPagerAdapter +import tachiyomi.core.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/WebtoonAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonAdapter.kt index 6b663173a3..71766a2e6c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonAdapter.kt @@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters import eu.kanade.tachiyomi.ui.reader.viewer.ReaderPageImageView import eu.kanade.tachiyomi.ui.reader.viewer.hasMissingChapters import eu.kanade.tachiyomi.util.system.createReaderThemeContext -import eu.kanade.tachiyomi.util.system.logcat +import tachiyomi.core.util.system.logcat /** * RecyclerView 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/WebtoonViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt index 472acfbeea..e25aab8a72 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 @@ -20,10 +20,10 @@ import eu.kanade.tachiyomi.ui.reader.model.ViewerChapters import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.ui.reader.viewer.BaseViewer import eu.kanade.tachiyomi.ui.reader.viewer.ViewerNavigation.NavigationRegion -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.MainScope import kotlinx.coroutines.cancel import rx.subscriptions.CompositeSubscription +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get import uy.kohesive.injekt.injectLazy diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/security/UnlockActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/security/UnlockActivity.kt index 0997c12e62..b697a98d1b 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.activity.BaseActivity import eu.kanade.tachiyomi.ui.base.delegate.SecureActivityDelegate import eu.kanade.tachiyomi.util.system.AuthenticatorUtil import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.startAuthentication -import eu.kanade.tachiyomi.util.system.logcat import logcat.LogPriority +import tachiyomi.core.util.system.logcat /** * Blank activity with a BiometricPrompt. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/AnilistLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/AnilistLoginActivity.kt index 8a2281b66d..001fd265d9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/AnilistLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/AnilistLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting.track import android.net.Uri import androidx.lifecycle.lifecycleScope -import eu.kanade.tachiyomi.util.lang.launchIO +import tachiyomi.core.util.lang.launchIO class AnilistLoginActivity : BaseOAuthLoginActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/BangumiLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/BangumiLoginActivity.kt index ed0c9bbef9..b1bea5d7a3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/BangumiLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/BangumiLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting.track import android.net.Uri import androidx.lifecycle.lifecycleScope -import eu.kanade.tachiyomi.util.lang.launchIO +import tachiyomi.core.util.lang.launchIO class BangumiLoginActivity : BaseOAuthLoginActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/MyAnimeListLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/MyAnimeListLoginActivity.kt index 2dac81b759..8b33a8fab1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/MyAnimeListLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/MyAnimeListLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting.track import android.net.Uri import androidx.lifecycle.lifecycleScope -import eu.kanade.tachiyomi.util.lang.launchIO +import tachiyomi.core.util.lang.launchIO class MyAnimeListLoginActivity : BaseOAuthLoginActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/ShikimoriLoginActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/ShikimoriLoginActivity.kt index bfb75c9991..a5884bbc64 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/ShikimoriLoginActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/track/ShikimoriLoginActivity.kt @@ -2,7 +2,7 @@ package eu.kanade.tachiyomi.ui.setting.track import android.net.Uri import androidx.lifecycle.lifecycleScope -import eu.kanade.tachiyomi.util.lang.launchIO +import tachiyomi.core.util.lang.launchIO class ShikimoriLoginActivity : BaseOAuthLoginActivity() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt index 7a53e046ed..cc112675bd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/stats/StatsScreenModel.kt @@ -20,8 +20,8 @@ import eu.kanade.tachiyomi.data.preference.MANGA_NON_COMPLETED import eu.kanade.tachiyomi.data.preference.MANGA_NON_READ import eu.kanade.tachiyomi.data.track.TrackManager import eu.kanade.tachiyomi.source.model.SManga -import eu.kanade.tachiyomi.util.lang.launchIO import kotlinx.coroutines.flow.update +import tachiyomi.core.util.lang.launchIO import tachiyomi.domain.library.model.LibraryManga import tachiyomi.domain.track.model.Track import uy.kohesive.injekt.Injekt diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt index a35cc0c918..494f445391 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt @@ -26,11 +26,8 @@ import eu.kanade.tachiyomi.data.download.DownloadService import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.library.LibraryUpdateService import eu.kanade.tachiyomi.source.SourceManager -import eu.kanade.tachiyomi.util.lang.launchIO -import eu.kanade.tachiyomi.util.lang.launchNonCancellable import eu.kanade.tachiyomi.util.lang.toDateKey import eu.kanade.tachiyomi.util.lang.toRelativeString -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch @@ -42,6 +39,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.domain.chapter.model.ChapterUpdate import tachiyomi.domain.updates.model.UpdatesWithRelations import uy.kohesive.injekt.Injekt 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 337ca59397..12ae057141 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 @@ -13,12 +13,12 @@ import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.ui.base.activity.BaseActivity import eu.kanade.tachiyomi.util.system.WebViewUtil -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.view.setComposeContent import okhttp3.HttpUrl.Companion.toHttpUrl +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.injectLazy class WebViewActivity : BaseActivity() { 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 4b7f666e87..a050560860 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 @@ -7,11 +7,11 @@ import eu.kanade.presentation.more.stats.StatsScreenState import eu.kanade.tachiyomi.network.NetworkHelper import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.online.HttpSource -import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.openInBrowser import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toast import okhttp3.HttpUrl.Companion.toHttpUrl +import tachiyomi.core.util.system.logcat import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get 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 e8b7f7969b..9d1bf13ae6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/CrashLogUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/CrashLogUtil.kt @@ -7,13 +7,13 @@ import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications -import eu.kanade.tachiyomi.util.lang.withNonCancellableContext -import eu.kanade.tachiyomi.util.lang.withUIContext import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.system.createFileInCacheDir import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notificationManager import eu.kanade.tachiyomi.util.system.toast +import tachiyomi.core.util.lang.withNonCancellableContext +import tachiyomi.core.util.lang.withUIContext class CrashLogUtil(private val context: Context) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceExtensions.kt index 213c94f274..d8cf1a61f0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/preference/PreferenceExtensions.kt @@ -1,9 +1,9 @@ package eu.kanade.tachiyomi.util.preference import android.widget.CompoundButton -import eu.kanade.tachiyomi.core.preference.Preference import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.onEach +import tachiyomi.core.preference.Preference /** * Binds a checkbox or switch view with a boolean preference. 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 570dd440fa..c51605cb62 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 @@ -42,6 +42,7 @@ 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.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/util/system/ImageUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt index 66db845788..e4eebbce6b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ImageUtil.kt @@ -22,6 +22,7 @@ import androidx.core.graphics.green import androidx.core.graphics.red import com.hippo.unifile.UniFile import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.decoder.Format import tachiyomi.decoder.ImageDecoder import java.io.BufferedInputStream diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/MaterialSpinnerView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/MaterialSpinnerView.kt index 9bfe337f13..38cdc0f19e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/MaterialSpinnerView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/MaterialSpinnerView.kt @@ -16,9 +16,9 @@ import androidx.core.view.forEach import androidx.core.view.get import androidx.core.view.size import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.core.preference.Preference import eu.kanade.tachiyomi.databinding.PrefSpinnerBinding import eu.kanade.tachiyomi.util.system.getResourceColor +import tachiyomi.core.preference.Preference class MaterialSpinnerView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : FrameLayout(context, attrs) { diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt b/core/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt index effe1e4114..371bd776b7 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/core/security/SecurityPreferences.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.core.security import eu.kanade.tachiyomi.core.R -import eu.kanade.tachiyomi.core.preference.PreferenceStore -import eu.kanade.tachiyomi.core.preference.getEnum +import tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.preference.getEnum class SecurityPreferences( private val preferenceStore: PreferenceStore, diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt b/core/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt index e3e3577cca..3517d1dc9c 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/JavaScriptEngine.kt +++ b/core/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 eu.kanade.tachiyomi.util.lang.withIOContext +import tachiyomi.core.util.lang.withIOContext /** * Util for evaluating JavaScript in sources. diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt b/core/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt index c184bd250e..bf6b5fc1d8 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/network/NetworkPreferences.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.network -import eu.kanade.tachiyomi.core.preference.Preference -import eu.kanade.tachiyomi.core.preference.PreferenceStore +import tachiyomi.core.preference.Preference +import tachiyomi.core.preference.PreferenceStore class NetworkPreferences( private val preferenceStore: PreferenceStore, diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt b/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt index 9ebe929659..70436ad275 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/network/interceptor/WebViewInterceptor.kt @@ -7,7 +7,6 @@ import android.webkit.WebView import android.widget.Toast import eu.kanade.tachiyomi.core.R import eu.kanade.tachiyomi.network.NetworkHelper -import eu.kanade.tachiyomi.util.lang.launchUI import eu.kanade.tachiyomi.util.system.DeviceUtil import eu.kanade.tachiyomi.util.system.WebViewUtil import eu.kanade.tachiyomi.util.system.setDefaultSettings @@ -16,6 +15,7 @@ import okhttp3.Headers import okhttp3.Interceptor import okhttp3.Request import okhttp3.Response +import tachiyomi.core.util.lang.launchUI import uy.kohesive.injekt.injectLazy import java.util.Locale import java.util.concurrent.CountDownLatch diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt b/core/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt index 5926d04507..7f3f6eaaf5 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/util/system/DeviceUtil.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.util.system import android.annotation.SuppressLint import android.os.Build import logcat.LogPriority +import tachiyomi.core.util.system.logcat object DeviceUtil { diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt b/core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt index f7acc58f00..1ab799228d 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/util/system/WebViewUtil.kt @@ -7,6 +7,7 @@ import android.webkit.CookieManager import android.webkit.WebSettings import android.webkit.WebView import logcat.LogPriority +import tachiyomi.core.util.system.logcat object WebViewUtil { const val SPOOF_PACKAGE_NAME = "org.chromium.chrome" diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/preference/AndroidPreference.kt b/core/src/main/java/tachiyomi/core/preference/AndroidPreference.kt similarity index 99% rename from core/src/main/java/eu/kanade/tachiyomi/core/preference/AndroidPreference.kt rename to core/src/main/java/tachiyomi/core/preference/AndroidPreference.kt index 05d63ee18e..00f3701d06 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/preference/AndroidPreference.kt +++ b/core/src/main/java/tachiyomi/core/preference/AndroidPreference.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.core.preference +package tachiyomi.core.preference import android.content.SharedPreferences import android.content.SharedPreferences.Editor diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/preference/AndroidPreferenceStore.kt b/core/src/main/java/tachiyomi/core/preference/AndroidPreferenceStore.kt similarity index 79% rename from core/src/main/java/eu/kanade/tachiyomi/core/preference/AndroidPreferenceStore.kt rename to core/src/main/java/tachiyomi/core/preference/AndroidPreferenceStore.kt index f028148d2d..74c2872d89 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/preference/AndroidPreferenceStore.kt +++ b/core/src/main/java/tachiyomi/core/preference/AndroidPreferenceStore.kt @@ -1,17 +1,17 @@ -package eu.kanade.tachiyomi.core.preference +package tachiyomi.core.preference import android.content.Context import android.content.SharedPreferences import androidx.preference.PreferenceManager -import eu.kanade.tachiyomi.core.preference.AndroidPreference.BooleanPrimitive -import eu.kanade.tachiyomi.core.preference.AndroidPreference.FloatPrimitive -import eu.kanade.tachiyomi.core.preference.AndroidPreference.IntPrimitive -import eu.kanade.tachiyomi.core.preference.AndroidPreference.LongPrimitive -import eu.kanade.tachiyomi.core.preference.AndroidPreference.Object -import eu.kanade.tachiyomi.core.preference.AndroidPreference.StringPrimitive -import eu.kanade.tachiyomi.core.preference.AndroidPreference.StringSetPrimitive 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 class AndroidPreferenceStore( context: Context, diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/preference/Preference.kt b/core/src/main/java/tachiyomi/core/preference/Preference.kt similarity index 91% rename from core/src/main/java/eu/kanade/tachiyomi/core/preference/Preference.kt rename to core/src/main/java/tachiyomi/core/preference/Preference.kt index dc898f4d83..c276141e98 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/preference/Preference.kt +++ b/core/src/main/java/tachiyomi/core/preference/Preference.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.core.preference +package tachiyomi.core.preference import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/preference/PreferenceStore.kt b/core/src/main/java/tachiyomi/core/preference/PreferenceStore.kt similarity index 96% rename from core/src/main/java/eu/kanade/tachiyomi/core/preference/PreferenceStore.kt rename to core/src/main/java/tachiyomi/core/preference/PreferenceStore.kt index c4a1abe839..f8cc9f8905 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/preference/PreferenceStore.kt +++ b/core/src/main/java/tachiyomi/core/preference/PreferenceStore.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.core.preference +package tachiyomi.core.preference interface PreferenceStore { diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/provider/AndroidBackupFolderProvider.kt b/core/src/main/java/tachiyomi/core/provider/AndroidBackupFolderProvider.kt similarity index 93% rename from core/src/main/java/eu/kanade/tachiyomi/core/provider/AndroidBackupFolderProvider.kt rename to core/src/main/java/tachiyomi/core/provider/AndroidBackupFolderProvider.kt index d9d0a02016..aa87b930d1 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/provider/AndroidBackupFolderProvider.kt +++ b/core/src/main/java/tachiyomi/core/provider/AndroidBackupFolderProvider.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.core.provider +package tachiyomi.core.provider import android.content.Context import android.os.Environment diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/provider/AndroidDownloadFolderProvider.kt b/core/src/main/java/tachiyomi/core/provider/AndroidDownloadFolderProvider.kt similarity index 93% rename from core/src/main/java/eu/kanade/tachiyomi/core/provider/AndroidDownloadFolderProvider.kt rename to core/src/main/java/tachiyomi/core/provider/AndroidDownloadFolderProvider.kt index 267ddc7ee9..042a586c21 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/provider/AndroidDownloadFolderProvider.kt +++ b/core/src/main/java/tachiyomi/core/provider/AndroidDownloadFolderProvider.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.core.provider +package tachiyomi.core.provider import android.content.Context import android.os.Environment diff --git a/core/src/main/java/eu/kanade/tachiyomi/core/provider/FolderProvider.kt b/core/src/main/java/tachiyomi/core/provider/FolderProvider.kt similarity index 70% rename from core/src/main/java/eu/kanade/tachiyomi/core/provider/FolderProvider.kt rename to core/src/main/java/tachiyomi/core/provider/FolderProvider.kt index 167e04e6b1..b4e124cee0 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/core/provider/FolderProvider.kt +++ b/core/src/main/java/tachiyomi/core/provider/FolderProvider.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.core.provider +package tachiyomi.core.provider import java.io.File diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/BooleanExtensions.kt b/core/src/main/java/tachiyomi/core/util/lang/BooleanExtensions.kt similarity index 57% rename from core/src/main/java/eu/kanade/tachiyomi/util/BooleanExtensions.kt rename to core/src/main/java/tachiyomi/core/util/lang/BooleanExtensions.kt index 07c8019268..8534995503 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/BooleanExtensions.kt +++ b/core/src/main/java/tachiyomi/core/util/lang/BooleanExtensions.kt @@ -1,3 +1,3 @@ -package eu.kanade.tachiyomi.util +package tachiyomi.core.util.lang fun Boolean.toLong() = if (this) 1L else 0L diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt b/core/src/main/java/tachiyomi/core/util/lang/CoroutinesExtensions.kt similarity index 98% rename from core/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt rename to core/src/main/java/tachiyomi/core/util/lang/CoroutinesExtensions.kt index 41d6970244..4573b2d858 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/lang/CoroutinesExtensions.kt +++ b/core/src/main/java/tachiyomi/core/util/lang/CoroutinesExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util.lang +package tachiyomi.core.util.lang import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/lang/RxCoroutineBridge.kt b/core/src/main/java/tachiyomi/core/util/lang/RxCoroutineBridge.kt similarity index 98% rename from core/src/main/java/eu/kanade/tachiyomi/util/lang/RxCoroutineBridge.kt rename to core/src/main/java/tachiyomi/core/util/lang/RxCoroutineBridge.kt index 0a80e8485c..8cba4caaca 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/lang/RxCoroutineBridge.kt +++ b/core/src/main/java/tachiyomi/core/util/lang/RxCoroutineBridge.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util.lang +package tachiyomi.core.util.lang import kotlinx.coroutines.CancellableContinuation import kotlinx.coroutines.CancellationException diff --git a/core/src/main/java/eu/kanade/tachiyomi/util/system/LogcatExtensions.kt b/core/src/main/java/tachiyomi/core/util/system/LogcatExtensions.kt similarity index 90% rename from core/src/main/java/eu/kanade/tachiyomi/util/system/LogcatExtensions.kt rename to core/src/main/java/tachiyomi/core/util/system/LogcatExtensions.kt index 5e2e9c5259..fb587b07d7 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/util/system/LogcatExtensions.kt +++ b/core/src/main/java/tachiyomi/core/util/system/LogcatExtensions.kt @@ -1,4 +1,4 @@ -package eu.kanade.tachiyomi.util.system +package tachiyomi.core.util.system import logcat.LogPriority import logcat.asLog diff --git a/data/src/main/java/tachiyomi/data/chapter/ChapterRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/chapter/ChapterRepositoryImpl.kt index 259787466c..69060ecb4e 100644 --- a/data/src/main/java/tachiyomi/data/chapter/ChapterRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/chapter/ChapterRepositoryImpl.kt @@ -1,9 +1,9 @@ package tachiyomi.data.chapter -import eu.kanade.tachiyomi.util.system.logcat -import eu.kanade.tachiyomi.util.toLong import kotlinx.coroutines.flow.Flow import logcat.LogPriority +import tachiyomi.core.util.lang.toLong +import tachiyomi.core.util.system.logcat import tachiyomi.data.DatabaseHandler import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.ChapterUpdate diff --git a/data/src/main/java/tachiyomi/data/history/HistoryRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/history/HistoryRepositoryImpl.kt index b7d00af1d1..f13569693a 100644 --- a/data/src/main/java/tachiyomi/data/history/HistoryRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/history/HistoryRepositoryImpl.kt @@ -1,8 +1,8 @@ package tachiyomi.data.history -import eu.kanade.tachiyomi.util.system.logcat import kotlinx.coroutines.flow.Flow import logcat.LogPriority +import tachiyomi.core.util.system.logcat import tachiyomi.data.DatabaseHandler import tachiyomi.domain.history.model.HistoryUpdate import tachiyomi.domain.history.model.HistoryWithRelations diff --git a/data/src/main/java/tachiyomi/data/manga/MangaRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/manga/MangaRepositoryImpl.kt index 3207595831..25b5f59e7e 100644 --- a/data/src/main/java/tachiyomi/data/manga/MangaRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/manga/MangaRepositoryImpl.kt @@ -1,9 +1,9 @@ package tachiyomi.data.manga -import eu.kanade.tachiyomi.util.system.logcat -import eu.kanade.tachiyomi.util.toLong import kotlinx.coroutines.flow.Flow import logcat.LogPriority +import tachiyomi.core.util.lang.toLong +import tachiyomi.core.util.system.logcat import tachiyomi.data.DatabaseHandler import tachiyomi.data.listOfStringsAdapter import tachiyomi.data.updateStrategyAdapter diff --git a/app/src/main/java/eu/kanade/data/source/SourceDataRepositoryImpl.kt b/data/src/main/java/tachiyomi/data/source/SourceDataRepositoryImpl.kt similarity index 96% rename from app/src/main/java/eu/kanade/data/source/SourceDataRepositoryImpl.kt rename to data/src/main/java/tachiyomi/data/source/SourceDataRepositoryImpl.kt index 8616d134fa..1e0e3bf1a1 100644 --- a/app/src/main/java/eu/kanade/data/source/SourceDataRepositoryImpl.kt +++ b/data/src/main/java/tachiyomi/data/source/SourceDataRepositoryImpl.kt @@ -1,4 +1,4 @@ -package eu.kanade.data.source +package tachiyomi.data.source import kotlinx.coroutines.flow.Flow import tachiyomi.data.DatabaseHandler diff --git a/data/src/main/java/tachiyomi/data/source/SourceMapper.kt b/data/src/main/java/tachiyomi/data/source/SourceMapper.kt new file mode 100644 index 0000000000..416de4692e --- /dev/null +++ b/data/src/main/java/tachiyomi/data/source/SourceMapper.kt @@ -0,0 +1,7 @@ +package tachiyomi.data.source + +import tachiyomi.domain.source.model.SourceData + +val sourceDataMapper: (Long, String, String) -> SourceData = { id, lang, name -> + SourceData(id, lang, name) +} diff --git a/presentation-core/build.gradle.kts b/presentation-core/build.gradle.kts index 9dfd4731f8..c8151eb055 100644 --- a/presentation-core/build.gradle.kts +++ b/presentation-core/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("com.android.library") - id("org.jetbrains.kotlin.android") + kotlin("android") } android { diff --git a/presentation-widget/build.gradle.kts b/presentation-widget/build.gradle.kts index 5553e2dcf9..18972c3885 100644 --- a/presentation-widget/build.gradle.kts +++ b/presentation-widget/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("com.android.library") - id("org.jetbrains.kotlin.android") + kotlin("android") } android { @@ -29,5 +29,4 @@ dependencies { implementation(androidx.glance) implementation(libs.coil.core) - } diff --git a/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceWidget.kt b/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceWidget.kt index 4465e1303d..6573dbbd93 100644 --- a/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceWidget.kt +++ b/presentation-widget/src/main/java/tachiyomi/presentation/widget/UpdatesGridGlanceWidget.kt @@ -22,9 +22,9 @@ import coil.size.Precision import coil.size.Scale import coil.transform.RoundedCornersTransformation import eu.kanade.tachiyomi.core.security.SecurityPreferences -import eu.kanade.tachiyomi.util.lang.launchIO import eu.kanade.tachiyomi.util.system.dpToPx import kotlinx.coroutines.MainScope +import tachiyomi.core.util.lang.launchIO import tachiyomi.data.DatabaseHandler import tachiyomi.domain.manga.model.MangaCover import tachiyomi.presentation.widget.components.CoverHeight diff --git a/source-api/src/main/java/eu/kanade/tachiyomi/source/Source.kt b/source-api/src/main/java/eu/kanade/tachiyomi/source/Source.kt index 32dccbb735..62c6f5e9b6 100644 --- a/source-api/src/main/java/eu/kanade/tachiyomi/source/Source.kt +++ b/source-api/src/main/java/eu/kanade/tachiyomi/source/Source.kt @@ -3,8 +3,8 @@ package eu.kanade.tachiyomi.source import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga -import eu.kanade.tachiyomi.util.lang.awaitSingle import rx.Observable +import tachiyomi.core.util.lang.awaitSingle /** * A basic interface for creating a source. It could be an online source, a local source, etc...