Skip to content

Commit

Permalink
feat(settings/Instance): add setting for local feed extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
FineFindus committed Nov 10, 2024
1 parent 6586c9a commit a457181
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ object PreferenceKeys {
const val DISABLE_VIDEO_IMAGE_PROXY = "disable_video_image_proxy"
const val LOCAL_RYD = "local_return_youtube_dislikes"
const val LOCAL_STREAM_EXTRACTION = "local_stream_extraction"
const val LOCAL_FEED_EXTRACTION = "local_feed_extraction"

// History
const val WATCH_HISTORY_SIZE = "watch_history_size"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ object PlayerHelper {
true
)

val localFeedExtraction: Boolean
get() = PreferenceHelper.getBoolean(
PreferenceKeys.LOCAL_FEED_EXTRACTION,
true
)

val useHlsOverDash: Boolean
get() = PreferenceHelper.getBoolean(
PreferenceKeys.USE_HLS_OVER_DASH,
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@
<string name="dialog_play_offline_title">A local version of this video is available.</string>
<string name="dialog_play_offline_body">Would you like to play the video from the download folder?</string>
<string name="view_count">%1$s views</string>
<string name="local_feed_extraction">Local feed extraction</string>
<string name="local_feed_extraction_summary">Directly fetch the video feed from YouTube without using Piped.</string>

<!-- Notification channel strings -->
<string name="download_channel_name">Download Service</string>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/xml/instance_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@
android:dependency="local_stream_extraction"
app:key="local_return_youtube_dislikes" />

<SwitchPreferenceCompat
android:defaultValue="true"
android:icon="@drawable/media3_icon_feed"
android:summary="@string/local_feed_extraction_summary"
android:title="@string/local_feed_extraction"
android:dependency="disable_video_image_proxy"
app:key="local_feed_extraction" />

</PreferenceCategory>

</PreferenceScreen>

0 comments on commit a457181

Please sign in to comment.