Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix(YouTube Music - Disable auto captions): Captions cannot be change…
Browse files Browse the repository at this point in the history
…d when `Disable forced auto captions` is turned on
  • Loading branch information
inotia00 authored and anddea committed Sep 16, 2024
1 parent cbe3fb7 commit 1cce551
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ public static String changeStartPage(final String browseId) {

// endregion

// region [Disable auto captions] patch

public static boolean disableAutoCaptions(boolean original) {
return Settings.DISABLE_AUTO_CAPTIONS.get() || original;
}

// endregion

// region [Disable auto captions] patch
// region [Disable dislike redirection] patch

public static boolean disableDislikeRedirection() {
return Settings.DISABLE_DISLIKE_REDIRECTION.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public class Settings extends BaseSettings {

// PreferenceScreen: General
public static final StringSetting CHANGE_START_PAGE = new StringSetting("revanced_change_start_page", "FEmusic_home", true);
public static final BooleanSetting DISABLE_AUTO_CAPTIONS = new BooleanSetting("revanced_disable_auto_captions", FALSE, true);
public static final BooleanSetting DISABLE_DISLIKE_REDIRECTION = new BooleanSetting("revanced_disable_dislike_redirection", FALSE);
public static final BooleanSetting ENABLE_LANDSCAPE_MODE = new BooleanSetting("revanced_enable_landscape_mode", FALSE, true);
public static final BooleanSetting CUSTOM_FILTER = new BooleanSetting("revanced_custom_filter", FALSE);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package app.revanced.integrations.shared.patches;

import app.revanced.integrations.shared.settings.BaseSettings;

@SuppressWarnings("unused")
public final class AutoCaptionsPatch {

private static boolean captionsButtonStatus;

public static boolean disableAutoCaptions() {
return BaseSettings.DISABLE_AUTO_CAPTIONS.get() &&
!captionsButtonStatus;
}

public static void setCaptionsButtonStatus(boolean status) {
captionsButtonStatus = status;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class BaseSettings {
public static final BooleanSetting HIDE_SETTINGS_MENU = new BooleanSetting("revanced_hide_settings_menu", FALSE);
public static final StringSetting HIDE_SETTINGS_MENU_FILTER_STRINGS = new StringSetting("revanced_hide_settings_menu_filter_strings", "", true);

public static final BooleanSetting DISABLE_AUTO_CAPTIONS = new BooleanSetting("revanced_disable_auto_captions", FALSE, true);

public static final BooleanSetting BYPASS_IMAGE_REGION_RESTRICTIONS = new BooleanSetting("revanced_bypass_image_region_restrictions", FALSE, true);
public static final StringSetting BYPASS_IMAGE_REGION_RESTRICTIONS_DOMAIN = new StringSetting("revanced_bypass_image_region_restrictions_domain", "yt4.ggpht.com", true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,6 @@ public static ArrayList<Object> getFormatStreamModelArray(final ArrayList<Object

// endregion

// region [Disable auto captions] patch

private static boolean captionsButtonStatus;

public static boolean disableAutoCaptions() {
return Settings.DISABLE_AUTO_CAPTIONS.get() &&
!captionsButtonStatus;
}

public static void setCaptionsButtonStatus(boolean status) {
captionsButtonStatus = status;
}

// endregion

// region [Disable splash animation] patch

public static boolean disableSplashAnimation(boolean original) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ public class Settings extends BaseSettings {
// PreferenceScreen: General
public static final StringSetting CHANGE_START_PAGE = new StringSetting("revanced_change_start_page", "", true);
public static final BooleanSetting DISABLE_AUTO_AUDIO_TRACKS = new BooleanSetting("revanced_disable_auto_audio_tracks", FALSE);
public static final BooleanSetting DISABLE_AUTO_CAPTIONS = new BooleanSetting("revanced_disable_auto_captions", FALSE, true);
public static final BooleanSetting DISABLE_SPLASH_ANIMATION = new BooleanSetting("revanced_disable_splash_animation", FALSE, true);
public static final BooleanSetting ENABLE_GRADIENT_LOADING_SCREEN = new BooleanSetting("revanced_enable_gradient_loading_screen", FALSE, true);
public static final BooleanSetting HIDE_FLOATING_MICROPHONE = new BooleanSetting("revanced_hide_floating_microphone", TRUE, true);
Expand Down

0 comments on commit 1cce551

Please sign in to comment.