Przeglądaj źródła

Reset sort on update if using old sort by source setting

arkon 4 lat temu
rodzic
commit
abcb21491c

+ 7 - 0
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

+ 3 - 0
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
 }