fixes
This commit is contained in:
parent
1cfbb344b0
commit
04b5dd5f72
3 changed files with 10 additions and 5 deletions
|
|
@ -443,7 +443,7 @@ class DownloadVideoFragment(private var resultItem: ResultItem? = null, private
|
||||||
downloadItem.videoPreferences.compatibilityMode = it
|
downloadItem.videoPreferences.compatibilityMode = it
|
||||||
container.isEnabled = !it
|
container.isEnabled = !it
|
||||||
if (it) {
|
if (it) {
|
||||||
container.editText?.setText("mkv")
|
containerAutoCompleteTextView.setText("mkv",false)
|
||||||
downloadItem.container = "mkv"
|
downloadItem.container = "mkv"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -928,7 +928,7 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
||||||
|
|
||||||
val preferredAudioCodec = sharedPreferences.getString("audio_codec", "")!!
|
val preferredAudioCodec = sharedPreferences.getString("audio_codec", "")!!
|
||||||
val aCodecPrefIndex = context.getStringArray(R.array.audio_codec_values).indexOf(preferredAudioCodec)
|
val aCodecPrefIndex = context.getStringArray(R.array.audio_codec_values).indexOf(preferredAudioCodec)
|
||||||
val aCodecPref = runCatching { context.getStringArray(R.array.audio_codec_values_ytdlp)[aCodecPrefIndex] }.getOrElse { "" }
|
var aCodecPref = runCatching { context.getStringArray(R.array.audio_codec_values_ytdlp)[aCodecPrefIndex] }.getOrElse { "" }
|
||||||
|
|
||||||
when(type){
|
when(type){
|
||||||
DownloadViewModel.Type.audio -> {
|
DownloadViewModel.Type.audio -> {
|
||||||
|
|
@ -1129,7 +1129,7 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
||||||
}else{
|
}else{
|
||||||
if (downloadItem.videoPreferences.compatibilityMode) {
|
if (downloadItem.videoPreferences.compatibilityMode) {
|
||||||
request.addOption("--recode-video", "mp4")
|
request.addOption("--recode-video", "mp4")
|
||||||
request.addOption("--merge-output-format", "mkv")
|
request.addOption("--merge-output-format", "mp4/mkv")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
request.addOption("--merge-output-format", outputContainer.lowercase())
|
request.addOption("--merge-output-format", outputContainer.lowercase())
|
||||||
|
|
@ -1177,7 +1177,12 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
||||||
val preferredCodec = sharedPreferences.getString("video_codec", "")
|
val preferredCodec = sharedPreferences.getString("video_codec", "")
|
||||||
val preferredQuality = sharedPreferences.getString("video_quality", "best")
|
val preferredQuality = sharedPreferences.getString("video_quality", "best")
|
||||||
val vCodecPrefIndex = context.getStringArray(R.array.video_codec_values).indexOf(preferredCodec)
|
val vCodecPrefIndex = context.getStringArray(R.array.video_codec_values).indexOf(preferredCodec)
|
||||||
val vCodecPref = context.getStringArray(R.array.video_codec_values_ytdlp)[vCodecPrefIndex]
|
var vCodecPref = context.getStringArray(R.array.video_codec_values_ytdlp)[vCodecPrefIndex]
|
||||||
|
|
||||||
|
if (downloadItem.videoPreferences.compatibilityMode) {
|
||||||
|
vCodecPref = "h264"
|
||||||
|
aCodecPref = "aac"
|
||||||
|
}
|
||||||
|
|
||||||
val defaultFormats = context.resources.getStringArray(R.array.video_formats_values)
|
val defaultFormats = context.resources.getStringArray(R.array.video_formats_values)
|
||||||
val usingGenericFormat = defaultFormats.contains(videoF) || downloadItem.allFormats.isEmpty() || downloadItem.allFormats == formatUtil.getGenericVideoFormats(context.resources)
|
val usingGenericFormat = defaultFormats.contains(videoF) || downloadItem.allFormats.isEmpty() || downloadItem.allFormats == formatUtil.getGenericVideoFormats(context.resources)
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
<com.google.android.material.chip.Chip
|
||||||
android:id="@+id/recode_video"
|
android:id="@+id/recode_video"
|
||||||
style="@style/Widget.Material3.Chip.Filter.Elevated"
|
style="@style/Widget.Material3.Chip.Assist.Elevated"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:checked="false"
|
android:checked="false"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue