fix audio formats sorting not selecting preferred format id when showing generics
This commit is contained in:
parent
733e33ba78
commit
ffc4ded5af
1 changed files with 3 additions and 1 deletions
|
|
@ -528,7 +528,9 @@ class DownloadViewModel(private val application: Application) : AndroidViewModel
|
|||
Type.audio -> {
|
||||
return cloneFormat (
|
||||
try {
|
||||
val theFormats = formats.filter { it.vcodec.isBlank() || it.vcodec == "none" }
|
||||
val theFormats = formats.filter { it.vcodec.isBlank() || it.vcodec == "none" }.ifEmpty {
|
||||
formatUtil.getGenericAudioFormats(resources).sortedByDescending { it.filesize }
|
||||
}
|
||||
FormatUtil(application).sortAudioFormats(theFormats).first()
|
||||
}catch (e: Exception){
|
||||
formatUtil.getGenericAudioFormats(resources).first()
|
||||
|
|
|
|||
Loading…
Reference in a new issue