chore: Lint code

This commit is contained in:
inotia00
2024-12-08 15:46:41 +09:00
parent ac72748834
commit da10e62286
4 changed files with 10 additions and 5 deletions

View File

@ -20,6 +20,8 @@ import app.revanced.extension.youtube.utils.VideoUtils;
@SuppressWarnings("unused")
public class CustomPlaybackSpeedPatch {
private static final float PLAYBACK_SPEED_AUTO = Settings.DEFAULT_PLAYBACK_SPEED.defaultValue;
/**
* Maximum playback speed, exclusive value. Custom speeds must be less than this value.
* <p>
@ -27,7 +29,7 @@ public class CustomPlaybackSpeedPatch {
* and the UI selector starts flickering and acting weird.
* Over 10x and the speeds show up out of order in the UI selector.
*/
public static final float MAXIMUM_PLAYBACK_SPEED = 8;
public static final float PLAYBACK_SPEED_MAXIMUM = 8;
private static final String[] defaultSpeedEntries;
private static final String[] defaultSpeedEntryValues;
/**
@ -128,8 +130,8 @@ public class CustomPlaybackSpeedPatch {
throw new IllegalArgumentException();
}
if (speedFloat > MAXIMUM_PLAYBACK_SPEED) {
resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", MAXIMUM_PLAYBACK_SPEED));
if (speedFloat > PLAYBACK_SPEED_MAXIMUM) {
resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", PLAYBACK_SPEED_MAXIMUM));
loadCustomSpeeds();
return;
}

View File

@ -84,7 +84,7 @@ public class PlaybackSpeedPatch {
// With the 0.05x menu, if the speed is set by integrations to higher than 2.0x
// then the menu will allow increasing without bounds but the max speed is
// still capped to under 8.0x.
playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.MAXIMUM_PLAYBACK_SPEED - 0.05f);
playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.PLAYBACK_SPEED_MAXIMUM - 0.05f);
// Prevent toast spamming if using the 0.05x adjustments.
// Show exactly one toast after the user stops interacting with the speed menu.