Further cleanup maxBitrate function
This commit is contained in:
parent
a66d07ae84
commit
aac73cd6d7
|
@ -69,14 +69,21 @@ object Settings {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val maxBitRate: Int
|
val maxBitRate: Int
|
||||||
get() {
|
get() {
|
||||||
val preferences = preferences
|
val network = Util.networkInfo()
|
||||||
return preferences.getString(
|
|
||||||
if (Util.networkInfo().unmetered) Constants.PREFERENCES_KEY_MAX_BITRATE_WIFI
|
if (!network.connected) return 0
|
||||||
else Constants.PREFERENCES_KEY_MAX_BITRATE_MOBILE,
|
|
||||||
"0"
|
if (network.unmetered) {
|
||||||
)!!.toInt()
|
return maxWifiBitRate
|
||||||
|
} else {
|
||||||
|
return maxMobileBitRate
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var maxWifiBitRate by StringIntSetting(Constants.PREFERENCES_KEY_MAX_BITRATE_WIFI)
|
||||||
|
|
||||||
|
private var maxMobileBitRate by StringIntSetting(Constants.PREFERENCES_KEY_MAX_BITRATE_MOBILE)
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
val preloadCount: Int
|
val preloadCount: Int
|
||||||
get() {
|
get() {
|
||||||
|
|
Loading…
Reference in New Issue