add bitrate in format
This commit is contained in:
parent
6c1d67f200
commit
ad5a503321
5 changed files with 31 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import com.deniscerri.ytdl.database.models.Format
|
|||
import com.deniscerri.ytdl.database.viewmodel.DownloadViewModel
|
||||
import com.deniscerri.ytdl.database.viewmodel.DownloadViewModel.Type
|
||||
import com.deniscerri.ytdl.database.viewmodel.ResultViewModel
|
||||
import com.deniscerri.ytdl.ui.adapter.FormatAdapter
|
||||
import com.deniscerri.ytdl.util.Extensions.isYoutubeURL
|
||||
import com.deniscerri.ytdl.util.FormatUtil
|
||||
import com.deniscerri.ytdl.util.UiUtil
|
||||
|
|
|
|||
|
|
@ -175,6 +175,14 @@ object UiUtil {
|
|||
}
|
||||
}
|
||||
|
||||
formatCard.findViewById<TextView>(R.id.bitrate).apply {
|
||||
if (chosenFormat.tbr.isNullOrBlank() || (chosenFormat.vcodec.isNotBlank() && chosenFormat.vcodec != "none")) {
|
||||
isVisible = false
|
||||
}else{
|
||||
text = chosenFormat.tbr
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun populateCommandCard(card: MaterialCardView, item: CommandTemplate){
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@ class YTDLPUtil(private val context: Context, private val commandTemplateDao: Co
|
|||
|
||||
private fun YoutubeDLRequest.applyDefaultOptionsForFetchingData(url: String?) {
|
||||
addOption("--skip-download")
|
||||
addOption("--quiet")
|
||||
addOption("--ignore-errors")
|
||||
addOption("--no-warnings")
|
||||
addOption("-R", "1")
|
||||
addOption("--compat-options", "manifest-filesize-approx")
|
||||
val socketTimeout = sharedPreferences.getString("socket_timeout", "5")!!.ifEmpty { "5" }
|
||||
|
|
|
|||
|
|
@ -164,6 +164,24 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bitrate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rounded_corner"
|
||||
android:backgroundTint="?attr/colorPrimaryInverse"
|
||||
android:textColor="@color/white"
|
||||
android:clickable="false"
|
||||
android:gravity="center"
|
||||
android:minWidth="30dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:textStyle="bold"
|
||||
app:cornerRadius="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@
|
|||
</PreferenceCategory>
|
||||
|
||||
<Preference
|
||||
app:allowDividerAbove="true"
|
||||
app:icon="@drawable/baseline_reset_tv_24"
|
||||
app:key="reset_preferences"
|
||||
android:summary="@string/reset_preferences_in_screen"
|
||||
|
|
|
|||
Loading…
Reference in a new issue