Transcode at 320kbps when bandwidth limitation is enabled
This commit is contained in:
parent
45ad4bdb8e
commit
8e09dccb9f
|
@ -67,11 +67,20 @@ data class Track(
|
||||||
fun bestUpload(): Upload? {
|
fun bestUpload(): Upload? {
|
||||||
if (uploads.isEmpty()) return null
|
if (uploads.isEmpty()) return null
|
||||||
|
|
||||||
return when (PowerPreference.getDefaultFile().getString("media_cache_quality")) {
|
var bestUpload = when (PowerPreference.getDefaultFile().getString("media_cache_quality")) {
|
||||||
"quality" -> uploads.maxByOrNull { it.bitrate } ?: uploads[0]
|
"quality" -> uploads.maxByOrNull { it.bitrate } ?: uploads[0]
|
||||||
"size" -> uploads.minByOrNull { it.bitrate } ?: uploads[0]
|
"size" -> uploads.minByOrNull { it.bitrate } ?: uploads[0]
|
||||||
else -> uploads.maxByOrNull { it.bitrate } ?: uploads[0]
|
else -> uploads.maxByOrNull { it.bitrate } ?: uploads[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return when (PowerPreference.getDefaultFile().getString("bandwidth_limitation")) {
|
||||||
|
"unlimited" -> bestUpload
|
||||||
|
"limited" -> {
|
||||||
|
var listenUrl = bestUpload.listen_url
|
||||||
|
Upload(listenUrl.plus("&to=mp3&max_bitrate=320"), uploads[0].duration, 320_000)
|
||||||
|
}
|
||||||
|
else -> bestUpload
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun cover(): String? {
|
override fun cover(): String? {
|
||||||
|
|
Loading…
Reference in New Issue