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

Commit

Permalink
feat(YouTube - Default Quality & Speed): Add an option to disable toa…
Browse files Browse the repository at this point in the history
…sts when changing the default values
  • Loading branch information
Francesco146 committed Aug 4, 2024
1 parent 37d84d1 commit ebce7e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public static void userSelectedPlaybackSpeed(float playbackSpeed) {
return;

Settings.DEFAULT_PLAYBACK_SPEED.save(playbackSpeed);

if (!Settings.SHOW_TOAST_ON_DEFAULT_SPEED_CHANGE.get())
return;

showToastShort(str("revanced_remember_playback_speed_toast", playbackSpeed + "x"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ private static void userSelectedVideoQuality(final int defaultQuality) {
default -> wifiQualitySetting.save(defaultQuality);
}

if (!Settings.SHOW_TOAST_ON_DEFAULT_QUALITY_CHANGE.get())
return;

Utils.showToastShort(str("revanced_remember_video_quality_" + networkType.getName(), defaultQuality + "p"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ public class Settings extends BaseSettings {
public static final BooleanSetting CUSTOM_PLAYBACK_SPEED_MENU_TYPE = new BooleanSetting("revanced_custom_playback_speed_menu_type", FALSE, parent(ENABLE_CUSTOM_PLAYBACK_SPEED));
public static final StringSetting CUSTOM_PLAYBACK_SPEEDS = new StringSetting("revanced_custom_playback_speeds", "0.25\n0.5\n0.75\n1.0\n1.25\n1.5\n1.75\n2.0\n2.25\n2.5", true, parent(ENABLE_CUSTOM_PLAYBACK_SPEED));
public static final BooleanSetting REMEMBER_PLAYBACK_SPEED_LAST_SELECTED = new BooleanSetting("revanced_remember_playback_speed_last_selected", TRUE);
public static final BooleanSetting SHOW_TOAST_ON_DEFAULT_SPEED_CHANGE = new BooleanSetting("revanced_show_toast_remember_video_speed", TRUE);
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED = new BooleanSetting("revanced_remember_video_quality_last_selected", TRUE);
public static final BooleanSetting SHOW_TOAST_ON_DEFAULT_QUALITY_CHANGE = new BooleanSetting("revanced_show_toast_remember_video_quality", TRUE);
public static final BooleanSetting RESTORE_OLD_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_restore_old_video_quality_menu", TRUE, true);
// Experimental Flags
public static final BooleanSetting ENABLE_DEFAULT_PLAYBACK_SPEED_SHORTS = new BooleanSetting("revanced_enable_default_playback_speed_shorts", FALSE);
Expand Down

0 comments on commit ebce7e9

Please sign in to comment.