mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 06:17:57 +01:00 
			
		
		
		
	Default library updates to daily + wifi
This commit is contained in:
		| @@ -29,11 +29,12 @@ object Migrations { | ||||
|  | ||||
|             // Fresh install | ||||
|             if (oldVersion == 0) { | ||||
|                 // Set up default app updater task | ||||
|                 // Set up default background tasks | ||||
|                 if (BuildConfig.INCLUDE_UPDATER) { | ||||
|                     UpdaterJob.setupTask(context) | ||||
|                 } | ||||
|                 ExtensionUpdateJob.setupTask(context) | ||||
|                 LibraryUpdateJob.setupTask(context) | ||||
|                 return false | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -191,9 +191,9 @@ class PreferencesHelper(val context: Context) { | ||||
|  | ||||
|     fun removeAfterMarkedAsRead() = prefs.getBoolean(Keys.removeAfterMarkedAsRead, false) | ||||
|  | ||||
|     fun libraryUpdateInterval() = flowPrefs.getInt(Keys.libraryUpdateInterval, 0) | ||||
|     fun libraryUpdateInterval() = flowPrefs.getInt(Keys.libraryUpdateInterval, 24) | ||||
|  | ||||
|     fun libraryUpdateRestriction() = prefs.getStringSet(Keys.libraryUpdateRestriction, emptySet()) | ||||
|     fun libraryUpdateRestriction() = prefs.getStringSet(Keys.libraryUpdateRestriction, setOf("wifi")) | ||||
|  | ||||
|     fun libraryUpdateCategories() = flowPrefs.getStringSet(Keys.libraryUpdateCategories, emptySet()) | ||||
|  | ||||
|   | ||||
| @@ -89,7 +89,7 @@ class SettingsLibraryController : SettingsController() { | ||||
|                     R.string.update_12hour, R.string.update_24hour, R.string.update_48hour | ||||
|                 ) | ||||
|                 entryValues = arrayOf("0", "1", "2", "3", "6", "12", "24", "48") | ||||
|                 defaultValue = "0" | ||||
|                 defaultValue = "24" | ||||
|                 summary = "%s" | ||||
|  | ||||
|                 onChange { newValue -> | ||||
| @@ -104,6 +104,7 @@ class SettingsLibraryController : SettingsController() { | ||||
|                 entriesRes = arrayOf(R.string.wifi, R.string.charging) | ||||
|                 entryValues = arrayOf("wifi", "ac") | ||||
|                 summaryRes = R.string.pref_library_update_restriction_summary | ||||
|                 defaultValue = setOf("wifi") | ||||
|  | ||||
|                 preferences.libraryUpdateInterval().asImmediateFlow { isVisible = it > 0 } | ||||
|                     .launchIn(scope) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user