detekt(detekt): detekt

This commit is contained in:
Secozzi 2024-07-03 22:30:19 +02:00
parent 486db1fd53
commit 428c6e1e08
No known key found for this signature in database
GPG key ID: 71E9C97D8DDC2662
12 changed files with 12 additions and 4 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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(