let the user allow downloads on mobile data

Downloads asked the platform for an unmetered network and nothing more, so
there was no way to run them on mobile. A setting under Downloads now decides,
defaulting to Wi-Fi only, and it also governs roaming: the platform permits
roaming by default, which would have contradicted the Wi-Fi-only choice.

The flag rides the enqueue request like the download quality does, cached in the
source repository so the poller does not read the preference per row.
This commit is contained in:
austinried
2026-10-04 00:30:03 +00:00
parent 02b3ddbb98
commit caf8369924
9 changed files with 81 additions and 4 deletions
@@ -38,6 +38,11 @@ class SettingsViewModel(
.downloadQuality()
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), StreamQuality())
val downloadOverMetered: StateFlow<Boolean> =
userPreferences
.downloadOverMetered()
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), false)
val syncConcurrency: StateFlow<Int> =
userPreferences
.syncConcurrency()
@@ -59,6 +64,10 @@ class SettingsViewModel(
viewModelScope.launch { userPreferences.setDownloadQuality(quality) }
}
fun setDownloadOverMetered(allowed: Boolean) {
viewModelScope.launch { userPreferences.setDownloadOverMetered(allowed) }
}
fun setSyncConcurrency(value: Int) {
viewModelScope.launch { userPreferences.setSyncConcurrency(value) }
}