mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Merge pull request #1986 from Bnyro/master
option to not auto-insert related videos
This commit is contained in:
commit
0f609fb7a3
@ -79,9 +79,9 @@ object PreferenceKeys {
|
|||||||
const val PLAYER_RESIZE_MODE = "player_resize_mode"
|
const val PLAYER_RESIZE_MODE = "player_resize_mode"
|
||||||
const val SB_SKIP_MANUALLY = "sb_skip_manually_key"
|
const val SB_SKIP_MANUALLY = "sb_skip_manually_key"
|
||||||
const val SB_SHOW_MARKERS = "sb_show_markers"
|
const val SB_SHOW_MARKERS = "sb_show_markers"
|
||||||
const val PROGRESSIVE_LOADING_INTERVAL_SIZE = "progressive_loading_interval"
|
|
||||||
const val ALTERNATIVE_PLAYER_LAYOUT = "alternative_player_layout"
|
const val ALTERNATIVE_PLAYER_LAYOUT = "alternative_player_layout"
|
||||||
const val USE_HLS_OVER_DASH = "use_hls"
|
const val USE_HLS_OVER_DASH = "use_hls"
|
||||||
|
const val QUEUE_AUTO_INSERT_RELATED = "queue_insert_related_videos"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Background mode
|
* Background mode
|
||||||
|
@ -168,9 +168,11 @@ class BackgroundMode : Service() {
|
|||||||
PlayingQueue.insertPlaylist(playlistId!!, it)
|
PlayingQueue.insertPlaylist(playlistId!!, it)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
streams?.toStreamItem(videoId)?.let { PlayingQueue.updateCurrent(it) }
|
streams?.toStreamItem(videoId)?.let {
|
||||||
|
PlayingQueue.updateCurrent(it)
|
||||||
|
}
|
||||||
streams?.relatedStreams?.toTypedArray()?.let {
|
streams?.relatedStreams?.toTypedArray()?.let {
|
||||||
PlayingQueue.add(*it)
|
if (PlayerHelper.autoInsertRelatedVideos) PlayingQueue.add(*it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,9 +597,11 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
PlayingQueue.insertPlaylist(playlistId!!, streams.toStreamItem(videoId!!))
|
PlayingQueue.insertPlaylist(playlistId!!, streams.toStreamItem(videoId!!))
|
||||||
} else {
|
} else {
|
||||||
PlayingQueue.updateCurrent(streams.toStreamItem(videoId!!))
|
PlayingQueue.updateCurrent(streams.toStreamItem(videoId!!))
|
||||||
PlayingQueue.add(
|
if (PlayerHelper.autoInsertRelatedVideos) {
|
||||||
*streams.relatedStreams.orEmpty().toTypedArray()
|
PlayingQueue.add(
|
||||||
)
|
*streams.relatedStreams.orEmpty().toTypedArray()
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -288,6 +288,12 @@ object PlayerHelper {
|
|||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val autoInsertRelatedVideos: Boolean
|
||||||
|
get() = PreferenceHelper.getBoolean(
|
||||||
|
PreferenceKeys.QUEUE_AUTO_INSERT_RELATED,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
|
||||||
fun getDefaultResolution(context: Context): String {
|
fun getDefaultResolution(context: Context): String {
|
||||||
return if (NetworkHelper.isNetworkMobile(context)) {
|
return if (NetworkHelper.isNetworkMobile(context)) {
|
||||||
PreferenceHelper.getString(
|
PreferenceHelper.getString(
|
||||||
|
@ -385,6 +385,7 @@
|
|||||||
<string name="bookmark">Bookmark</string>
|
<string name="bookmark">Bookmark</string>
|
||||||
<string name="clear_bookmarks">Clear bookmarks</string>
|
<string name="clear_bookmarks">Clear bookmarks</string>
|
||||||
<string name="bookmarks_empty">No bookmarks yet!</string>
|
<string name="bookmarks_empty">No bookmarks yet!</string>
|
||||||
|
<string name="queue_insert_related_videos">Insert related videos</string>
|
||||||
|
|
||||||
<!-- Notification channel strings -->
|
<!-- Notification channel strings -->
|
||||||
<string name="download_channel_name">Download Service</string>
|
<string name="download_channel_name">Download Service</string>
|
||||||
|
@ -110,4 +110,14 @@
|
|||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory app:title="@string/queue">
|
||||||
|
|
||||||
|
<SwitchPreferenceCompat
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:icon="@drawable/ic_list"
|
||||||
|
android:title="@string/queue_insert_related_videos"
|
||||||
|
app:key="queue_insert_related_videos" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
Loading…
x
Reference in New Issue
Block a user