mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
use flow pref for libraryUpdateRestriction
since theres a crash using reg prefs for some reason
This commit is contained in:
parent
5addec2d82
commit
841293b8e8
2 changed files with 3 additions and 3 deletions
|
@ -37,7 +37,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
|
|||
val preferences = Injekt.get<PreferencesHelper>()
|
||||
val interval = prefInterval ?: preferences.libraryUpdateInterval().get()
|
||||
if (interval > 0) {
|
||||
val restrictions = preferences.libraryUpdateRestriction().orEmpty()
|
||||
val restrictions = preferences.libraryUpdateRestriction().get()
|
||||
|
||||
val constraints = Constraints.Builder()
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
|
@ -61,7 +61,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
|
|||
}
|
||||
|
||||
fun requiresWifiConnection(preferences: PreferencesHelper): Boolean {
|
||||
val restrictions = preferences.libraryUpdateRestriction().orEmpty()
|
||||
val restrictions = preferences.libraryUpdateRestriction().get()
|
||||
return "wifi" in restrictions
|
||||
}
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ class PreferencesHelper(val context: Context) {
|
|||
|
||||
fun libraryUpdateInterval() = flowPrefs.getInt(Keys.libraryUpdateInterval, 24)
|
||||
|
||||
fun libraryUpdateRestriction() = prefs.getStringSet(Keys.libraryUpdateRestriction, emptySet())
|
||||
fun libraryUpdateRestriction() = flowPrefs.getStringSet(Keys.libraryUpdateRestriction, emptySet())
|
||||
|
||||
fun libraryUpdateCategories() = flowPrefs.getStringSet(Keys.libraryUpdateCategories, emptySet())
|
||||
fun libraryUpdateCategoriesExclude() = flowPrefs.getStringSet(Keys.libraryUpdateCategoriesExclude, emptySet())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue