Merge pull request #4321 from Bnyro/master

feat: support for video visibility and license
This commit is contained in:
Bnyro 2023-07-29 16:41:52 +02:00 committed by GitHub
commit 95ecd2ea7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 2 deletions

View File

@ -18,6 +18,9 @@ data class Streams(
val uploaderAvatar: String? = null, val uploaderAvatar: String? = null,
val thumbnailUrl: String, val thumbnailUrl: String,
val category: String, val category: String,
val license: String,
val visibility: String,
val tags: List<String>,
val hls: String? = null, val hls: String? = null,
val dash: String? = null, val dash: String? = null,
val lbryId: String? = null, val lbryId: String? = null,

View File

@ -984,7 +984,17 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
val description = streams.description val description = streams.description
setupDescription(binding.playerDescription, description) setupDescription(binding.playerDescription, description)
binding.videoCategory.text = "${context?.getString(R.string.category)}: ${streams.category}" val visibility = when (streams.visibility) {
"public" -> context?.getString(R.string.visibility_public)
"unlisted" -> context?.getString(R.string.visibility_unlisted)
// currently no other visibility could be returned, might change in the future however
else -> streams.visibility.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
}
}.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"
binding.playerChannel.setOnClickListener { binding.playerChannel.setOnClickListener {
val activity = view?.context as MainActivity val activity = view?.context as MainActivity

View File

@ -125,7 +125,7 @@
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
android:id="@+id/video_category" android:id="@+id/additional_video_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="8dp" android:padding="8dp"

View File

@ -435,6 +435,9 @@
<string name="fallback_piped_proxy_desc">Load videos via the proxy if connecting to YouTube directly doesn\'t work for the current video (increases the initial loading times). If disabled, YouTube music content likely won\'t play due to YT restrictions.</string> <string name="fallback_piped_proxy_desc">Load videos via the proxy if connecting to YouTube directly doesn\'t work for the current video (increases the initial loading times). If disabled, YouTube music content likely won\'t play due to YT restrictions.</string>
<string name="dearrow">Enable DeArrow</string> <string name="dearrow">Enable DeArrow</string>
<string name="dearrow_summary">Show more accurate and less sensationalist titles and thumbnails. Increases loading times.</string> <string name="dearrow_summary">Show more accurate and less sensationalist titles and thumbnails. Increases loading times.</string>
<string name="visibility">Visibility</string>
<string name="visibility_public">Public</string>
<string name="visibility_unlisted">Unlisted</string>
<!-- Backup & Restore Settings --> <!-- Backup & Restore Settings -->
<string name="import_subscriptions_from">Import subscriptions from</string> <string name="import_subscriptions_from">Import subscriptions from</string>