diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/resource/patch/CustomVideoSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/resource/patch/CustomVideoSpeedPatch.kt index 043a1677a..ec0ed6dc7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/resource/patch/CustomVideoSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/customspeed/resource/patch/CustomVideoSpeedPatch.kt @@ -48,6 +48,8 @@ class CustomVideoSpeedPatch : ResourcePatch { ResourceHelper.addEntries(context, speedElements[index] + "x") } + ResourceHelper.addSpeed(context) + /* add settings */ diff --git a/src/main/kotlin/app/revanced/shared/util/resources/ResourceHelper.kt b/src/main/kotlin/app/revanced/shared/util/resources/ResourceHelper.kt index 586798356..6907d3d7a 100644 --- a/src/main/kotlin/app/revanced/shared/util/resources/ResourceHelper.kt +++ b/src/main/kotlin/app/revanced/shared/util/resources/ResourceHelper.kt @@ -58,6 +58,19 @@ internal object ResourceHelper { ) } + fun addSpeed( + context: ResourceContext + ) { + val prefs = context["res/xml/revanced_prefs.xml"] + prefs.writeText( + prefs.readText() + .replace( + "revanced_default_video_speed\"", + "revanced_default_video_speed\" android:entries=\"@array/revanced_video_speed_entries\" android:entryValues=\"@array/revanced_video_speed_entry_values\"" + ) + ) + } + fun addSettings( context: ResourceContext, PreferenceCategory: String, diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index 82756b0a0..98d94e5e3 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -292,7 +292,7 @@ SETTINGS: DEFAULT_VIDEO_QUALITY --> + SETTINGS: DEFAULT_VIDEO_SPEED -->