Skip to content

Commit

Permalink
fix(YouTube - SponsorBlock): Show correct segment behavior in setting…
Browse files Browse the repository at this point in the history
…s UI after importing
  • Loading branch information
LisoUseInAIKyrios authored and oSumAtrIX committed Nov 6, 2024
1 parent 906fce6 commit deb1d41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static void loadAllCategoriesFromSettings() {
@NonNull
public final String keyValue;
@NonNull
private final StringSetting behaviorSetting;
public final StringSetting behaviorSetting;
@NonNull
private final StringSetting colorSetting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ public SegmentCategoryListPreference(Context context, SegmentCategory category)
super(context);
final boolean isHighlightCategory = category == SegmentCategory.HIGHLIGHT;
this.category = Objects.requireNonNull(category);
setKey(category.keyValue);
setDefaultValue(category.behaviour.reVancedKeyValue);

// Edit: Using preferences to sync together multiple pieces
// of code together is messy and should be rethought.
setKey(category.behaviorSetting.key);
setDefaultValue(category.behaviorSetting.defaultValue);
setEntries(isHighlightCategory
? CategoryBehaviour.getBehaviorDescriptionsWithoutSkipOnce()
: CategoryBehaviour.getBehaviorDescriptions());
setEntryValues(isHighlightCategory
? CategoryBehaviour.getBehaviorKeyValuesWithoutSkipOnce()
: CategoryBehaviour.getBehaviorKeyValues());

setSummary(category.description.toString());
updateTitle();
}
Expand Down

0 comments on commit deb1d41

Please sign in to comment.