Ver código fonte

Minor cleanup

arkon 1 ano atrás
pai
commit
81448f5d01

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreator.kt

@@ -238,7 +238,7 @@ class BackupCreator(
     private fun backupSourcePreferences(flags: Int): List<BackupSourcePreferences> {
         if (flags and BACKUP_SOURCE_PREFS_MASK != BACKUP_SOURCE_PREFS) return emptyList()
 
-        return sourceManager.getOnlineSources()
+        return sourceManager.getCatalogueSources()
             .filterIsInstance<ConfigurableSource>()
             .map {
                 BackupSourcePreferences(

+ 9 - 6
app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt

@@ -89,6 +89,7 @@ import kotlinx.coroutines.flow.onEach
 import kotlinx.coroutines.launch
 import logcat.LogPriority
 import tachiyomi.core.Constants
+import tachiyomi.core.util.lang.launchIO
 import tachiyomi.core.util.system.logcat
 import tachiyomi.domain.library.service.LibraryPreferences
 import tachiyomi.domain.release.interactor.GetApplicationRelease
@@ -279,7 +280,9 @@ class MainActivity : BaseActivity() {
         setSplashScreenExitAnimation(splashScreen)
 
         if (isLaunch && libraryPreferences.autoClearChapterCache().get()) {
-            chapterCache.clear()
+            lifecycleScope.launchIO {
+                chapterCache.clear()
+            }
         }
     }
 
@@ -436,13 +439,13 @@ class MainActivity : BaseActivity() {
     }
 
     companion object {
-        // Splash screen
-        private const val SPLASH_MIN_DURATION = 500 // ms
-        private const val SPLASH_MAX_DURATION = 5000 // ms
-        private const val SPLASH_EXIT_ANIM_DURATION = 400L // ms
-
         const val INTENT_SEARCH = "eu.kanade.tachiyomi.SEARCH"
         const val INTENT_SEARCH_QUERY = "query"
         const val INTENT_SEARCH_FILTER = "filter"
     }
 }
+
+// Splash screen
+private const val SPLASH_MIN_DURATION = 500 // ms
+private const val SPLASH_MAX_DURATION = 5000 // ms
+private const val SPLASH_EXIT_ANIM_DURATION = 400L // ms