Skip to content

Commit

Permalink
feat(youtube/remember-video-quality): remember current quality option
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Oct 4, 2022
1 parent fbaa361 commit 90f7392
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.ArrayList;
import java.util.Collections;

import app.revanced.integrations.settings.SettingsEnum;
import app.revanced.integrations.utils.LogHelper;
import app.revanced.integrations.utils.ReVancedUtils;
import app.revanced.integrations.utils.SharedPrefHelper;
Expand Down Expand Up @@ -131,6 +132,9 @@ public static int setVideoQuality(Object[] qualities, int quality, Object qInter
}

public static void userChangedQuality(int selectedQuality) {
// Do not remember a **new** quality if REMEMBER_VIDEO_QUALITY is true
if (SettingsEnum.REMEMBER_VIDEO_QUALITY.getBoolean()) return;

selectedQuality1 = selectedQuality;
userChangedQuality = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum SettingsEnum {
//Video Settings
OLD_STYLE_QUALITY_SETTINGS("revanced_use_old_style_quality_settings", true, ReturnType.BOOLEAN),
PREFERRED_VIDEO_SPEED("revanced_pref_video_speed", -2.0f, ReturnType.FLOAT),
REMEMBER_VIDEO_QUALITY("revanced_remember_video_quality_selection", true, ReturnType.BOOLEAN),

//Whitelist Settings
//ToDo: Not used atm, Patch missing
Expand Down

0 comments on commit 90f7392

Please sign in to comment.