Reset sort on update if using old sort by source setting

This commit is contained in:
arkon 2020-05-01 19:59:08 -04:00
parent 33d2b0984f
commit abcb21491c
2 changed files with 10 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.updater.UpdaterJob import eu.kanade.tachiyomi.data.updater.UpdaterJob
import eu.kanade.tachiyomi.extension.ExtensionUpdateJob import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
import eu.kanade.tachiyomi.ui.library.LibrarySort
import java.io.File import java.io.File
object Migrations { object Migrations {
@ -82,6 +83,12 @@ object Migrations {
// New extension update check job // New extension update check job
ExtensionUpdateJob.setupTask(context) 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 true
} }
return false return false

View file

@ -8,4 +8,7 @@ object LibrarySort {
const val UNREAD = 3 const val UNREAD = 3
const val TOTAL = 4 const val TOTAL = 4
const val LATEST_CHAPTER = 6 const val LATEST_CHAPTER = 6
@Deprecated("Removed in favor of searching by source")
const val SOURCE = 5
} }