From abcb21491c1d41a556edf17757f73477a4bc0354 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 1 May 2020 19:59:08 -0400 Subject: [PATCH] Reset sort on update if using old sort by source setting --- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 7 +++++++ .../java/eu/kanade/tachiyomi/ui/library/LibrarySort.kt | 3 +++ 2 files changed, 10 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index 22f7a7f90..3b748d77a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateJob import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.updater.UpdaterJob import eu.kanade.tachiyomi.extension.ExtensionUpdateJob +import eu.kanade.tachiyomi.ui.library.LibrarySort import java.io.File object Migrations { @@ -82,6 +83,12 @@ object Migrations { // New extension update check job ExtensionUpdateJob.setupTask(context) } + if (oldVersion < 44) { + // Reset sorting preference if using removed sort by source + if (preferences.librarySortingMode().get() == LibrarySort.SOURCE) { + preferences.librarySortingMode().set(LibrarySort.ALPHA) + } + } return true } return false diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySort.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySort.kt index be629c09f..5dfdff91f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySort.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySort.kt @@ -8,4 +8,7 @@ object LibrarySort { const val UNREAD = 3 const val TOTAL = 4 const val LATEST_CHAPTER = 6 + + @Deprecated("Removed in favor of searching by source") + const val SOURCE = 5 }