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

Commit

Permalink
feat(YouTube Music - Video playback): Add an option to disable toasts…
Browse files Browse the repository at this point in the history
… when changing the default values
  • Loading branch information
inotia00 authored and Francesco146 committed Aug 28, 2024
1 parent c2ba880 commit 9fcead1
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 @@ -23,6 +23,10 @@ public static void userSelectedPlaybackSpeed(final float playbackSpeed) {
return;

Settings.DEFAULT_PLAYBACK_SPEED.save(playbackSpeed);

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

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

if (!Settings.REMEMBER_VIDEO_QUALITY_LAST_SELECTED_TOAST.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 @@ -145,7 +145,9 @@ public class Settings extends BaseSettings {
// PreferenceScreen: Video
public static final StringSetting CUSTOM_PLAYBACK_SPEEDS = new StringSetting("revanced_custom_playback_speeds", "0.5\n0.8\n1.0\n1.2\n1.5\n1.8\n2.0", true);
public static final BooleanSetting REMEMBER_PLAYBACK_SPEED_LAST_SELECTED = new BooleanSetting("revanced_remember_playback_speed_last_selected", TRUE);
public static final BooleanSetting REMEMBER_PLAYBACK_SPEED_LAST_SELECTED_TOAST = new BooleanSetting("revanced_remember_playback_speed_last_selected_toast", TRUE);
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED = new BooleanSetting("revanced_remember_video_quality_last_selected", TRUE);
public static final BooleanSetting REMEMBER_VIDEO_QUALITY_LAST_SELECTED_TOAST = new BooleanSetting("revanced_remember_video_quality_last_selected_toast", TRUE);
public static final FloatSetting DEFAULT_PLAYBACK_SPEED = new FloatSetting("revanced_default_playback_speed", 1.0f);
public static final IntegerSetting DEFAULT_VIDEO_QUALITY_MOBILE = new IntegerSetting("revanced_default_video_quality_mobile", -2);
public static final IntegerSetting DEFAULT_VIDEO_QUALITY_WIFI = new IntegerSetting("revanced_default_video_quality_wifi", -2);
Expand Down

0 comments on commit 9fcead1

Please sign in to comment.