Skip to content

Commit

Permalink
Merge pull request #4516 from Bnyro/master
Browse files Browse the repository at this point in the history
chore: fix formatting
  • Loading branch information
Bnyro authored Aug 16, 2023
2 parents 15dbee5 + 6639b47 commit fa90675
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ class LibraryFragment : Fragment() {

val sortOptions = resources.getStringArray(R.array.playlistSortingOptions)
val sortOptionValues = resources.getStringArray(R.array.playlistSortingOptionsValues)
val order = PreferenceHelper.getString(PreferenceKeys.PLAYLISTS_ORDER, sortOptionValues.first())
val order = PreferenceHelper.getString(
PreferenceKeys.PLAYLISTS_ORDER,
sortOptionValues.first()
)
val orderIndex = sortOptionValues.indexOf(order)
binding.sortTV.text = sortOptions.getOrNull(orderIndex)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
if (binding.playerMotionLayout.progress != 1.0f) {
// show controllers when not in picture in picture mode
val inPipMode = PlayerHelper.pipEnabled &&
PictureInPictureCompat.isInPictureInPictureMode(requireActivity())
PictureInPictureCompat.isInPictureInPictureMode(requireActivity())
if (!inPipMode) {
binding.player.useController = true
}
Expand Down Expand Up @@ -1005,8 +1005,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
}.orEmpty()
binding.additionalVideoInfo.text =
"${context?.getString(R.string.category)}: ${streams.category}\n" +
"${context?.getString(R.string.license)}: ${streams.license}\n" +
"${context?.getString(R.string.visibility)}: $visibility"
"${context?.getString(R.string.license)}: ${streams.license}\n" +
"${context?.getString(R.string.visibility)}: $visibility"

if (streams.tags.isNotEmpty()) {
binding.tagsRecycler.layoutManager =
Expand Down Expand Up @@ -1428,16 +1428,24 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
val subtitles = listOf(Subtitle(name = getString(R.string.none))).plus(streams.subtitles)

BaseBottomSheet()
.setSimpleItems(subtitles.map {
if (it.autoGenerated != true) it.name!!
else "${it.name} (${getString(R.string.auto_generated)})"
}) { index ->
.setSimpleItems(
subtitles.map {
if (it.autoGenerated != true) {
it.name!!
} else {
"${it.name} (${getString(R.string.auto_generated)})"
}
}
) { index ->
val subtitle = subtitles.getOrNull(index) ?: return@setSimpleItems
updateCaptionsLanguage(subtitle.code)
trackSelector.updateParameters {
trackSelector.updateParameters {
val roleFlags = if (subtitle.autoGenerated != true) C.ROLE_FLAG_CAPTION
else PlayerHelper.ROLE_FLAG_AUTO_GEN_SUBTITLE
val roleFlags = if (subtitle.autoGenerated != true) {
C.ROLE_FLAG_CAPTION
} else {
PlayerHelper.ROLE_FLAG_AUTO_GEN_SUBTITLE
}
this.setPreferredTextRoleFlags(roleFlags)
}
}
Expand Down

0 comments on commit fa90675

Please sign in to comment.