mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-26 23:18:17 +03:00
detekt(detekt): detekt
This commit is contained in:
parent
486db1fd53
commit
428c6e1e08
12 changed files with 12 additions and 4 deletions
|
@ -10,6 +10,7 @@ class EnableAutoBackupMigration : Migration {
|
|||
override val version = 84f
|
||||
|
||||
// Always attempt automatic backup creation
|
||||
@Suppress("MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val backupPreferences = migrationContext.get<BackupPreferences>() ?: return false
|
||||
|
|
|
@ -11,6 +11,7 @@ class MigrateRotationViewerValuesMigration : Migration {
|
|||
override val version = 60f
|
||||
|
||||
// Migrate Rotation and Viewer values to default values for viewer_flags
|
||||
@Suppress("MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
|
|
@ -11,6 +11,7 @@ class MigrateSortingModeMigration : Migration {
|
|||
override val version = 64f
|
||||
|
||||
// Switch to sort per category
|
||||
@Suppress("CyclomaticComplexMethod", "MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val libraryPreferences = migrationContext.get<LibraryPreferences>() ?: return false
|
||||
|
|
|
@ -12,6 +12,7 @@ class MovePlayerPreferencesMigration : Migration {
|
|||
override val version = 93f
|
||||
|
||||
// more migrations for player prefs
|
||||
@Suppress("SwallowedException")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val playerPreferences = migrationContext.get<PlayerPreferences>() ?: return false
|
||||
|
|
|
@ -11,6 +11,7 @@ class PlayerPreferenceMigration : Migration {
|
|||
override val version = 92f
|
||||
|
||||
// add migration for player preference
|
||||
@Suppress("SwallowedException")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val playerPreferences = migrationContext.get<PlayerPreferences>() ?: return false
|
||||
|
|
|
@ -9,6 +9,7 @@ class RelativeTimestampMigration : Migration {
|
|||
override val version = 106f
|
||||
|
||||
// Bring back simplified relative timestamp setting
|
||||
@Suppress("MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val preferenceStore = migrationContext.get<PreferenceStore>() ?: return false
|
||||
val uiPreferences = migrationContext.get<UiPreferences>() ?: return false
|
||||
|
|
|
@ -11,6 +11,7 @@ class RemoveOneTwoHourUpdateMigration : Migration {
|
|||
override val version = 61f
|
||||
|
||||
// Handle removed every 1 or 2 hour library updates
|
||||
@Suppress("MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val libraryPreferences = migrationContext.get<LibraryPreferences>() ?: return false
|
||||
|
|
|
@ -11,6 +11,7 @@ class RemoveQuickUpdateMigration : Migration {
|
|||
override val version = 71f
|
||||
|
||||
// Handle removed every 3, 4, 6, and 8 hour library updates
|
||||
@Suppress("MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val libraryPreferences = migrationContext.get<LibraryPreferences>() ?: return false
|
||||
|
|
|
@ -10,6 +10,7 @@ class RemoveReaderTapMigration : Migration {
|
|||
override val version = 77f
|
||||
|
||||
// Remove reader tapping option in favor of disabled nav layouts
|
||||
@Suppress("MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val readerPreferences = migrationContext.get<ReaderPreferences>() ?: return false
|
||||
|
|
|
@ -7,10 +7,11 @@ import mihon.core.migration.Migration
|
|||
import mihon.core.migration.MigrationContext
|
||||
import tachiyomi.domain.library.service.LibraryPreferences
|
||||
|
||||
class ResetSortPreferenceRemovedMigration : Migration {
|
||||
class ResetSortPreferenceRemovedMigration : Migration {
|
||||
override val version = 44f
|
||||
|
||||
// Reset sorting preference if using removed sort by source
|
||||
@Suppress("MagicNumber")
|
||||
override suspend fun invoke(migrationContext: MigrationContext): Boolean {
|
||||
val context = migrationContext.get<App>() ?: return false
|
||||
val libraryPreferences = migrationContext.get<LibraryPreferences>() ?: return false
|
||||
|
|
|
@ -4,8 +4,8 @@ import eu.kanade.domain.source.service.SourcePreferences
|
|||
import logcat.LogPriority
|
||||
import mihon.core.migration.Migration
|
||||
import mihon.core.migration.MigrationContext
|
||||
import mihon.domain.extensionrepo.exception.SaveExtensionRepoException
|
||||
import mihon.domain.extensionrepo.anime.repository.AnimeExtensionRepoRepository
|
||||
import mihon.domain.extensionrepo.exception.SaveExtensionRepoException
|
||||
import mihon.domain.extensionrepo.manga.repository.MangaExtensionRepoRepository
|
||||
import tachiyomi.core.common.util.lang.withIOContext
|
||||
import tachiyomi.core.common.util.system.logcat
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package mihon.domain.extensionrepo.manga.interactor
|
||||
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import logcat.LogPriority
|
||||
import mihon.domain.extensionrepo.exception.SaveExtensionRepoException
|
||||
import mihon.domain.extensionrepo.manga.repository.MangaExtensionRepoRepository
|
||||
import mihon.domain.extensionrepo.model.ExtensionRepo
|
||||
import mihon.domain.extensionrepo.service.ExtensionRepoService
|
||||
import okhttp3.OkHttpClient
|
||||
import tachiyomi.core.common.util.system.logcat
|
||||
|
||||
class CreateMangaExtensionRepo(
|
||||
|
|
Loading…
Reference in a new issue