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 d9a1ba3 commit bf20d16
Show file tree
Hide file tree
Showing 5 changed files with 26 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
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M6.18,15.64A2.18,2.18 0,0 1,8.36 17.82C8.36,19 7.38,20 6.18,20C5,20 4,19 4,17.82A2.18,2.18 0,0 1,6.18 15.64M4,4.44A15.56,15.56 0,0 1,19.56 20H16.73A12.73,12.73 0,0 0,4 7.27V4.44M4,10.1A9.9,9.9 0,0 1,13.9 20H11.07A7.07,7.07 0,0 0,4 12.93V10.1Z"/>
</vector>
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/ic_rss"
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 bf20d16

Please sign in to comment.