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

Commit

Permalink
fix: Properly migrate very old SB user id
Browse files Browse the repository at this point in the history
This migration is probably no longer needed since spoof client required everyone to update, but might as well keep this single non recoverable migration a little longer just in case.
  • Loading branch information
LisoUseInAIKyrios committed Sep 17, 2024
1 parent 1fd044d commit a673c74
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import static app.revanced.integrations.youtube.sponsorblock.objects.CategoryBehaviour.*;

import app.revanced.integrations.shared.settings.*;
import app.revanced.integrations.shared.settings.preference.SharedPrefCategory;
import app.revanced.integrations.youtube.patches.AlternativeThumbnailsPatch.DeArrowAvailability;
import app.revanced.integrations.youtube.patches.AlternativeThumbnailsPatch.StillImagesAvailability;
import app.revanced.integrations.youtube.patches.AlternativeThumbnailsPatch.ThumbnailOption;
import app.revanced.integrations.youtube.patches.AlternativeThumbnailsPatch.ThumbnailStillTime;
import app.revanced.integrations.youtube.patches.spoof.SpoofClientPatch;
import app.revanced.integrations.youtube.sponsorblock.SponsorBlockSettings;

@SuppressWarnings("deprecation")
public class Settings extends BaseSettings {
// Video
public static final BooleanSetting RESTORE_OLD_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_restore_old_video_quality_menu", TRUE);
Expand Down Expand Up @@ -294,7 +294,7 @@ public class Settings extends BaseSettings {
* Do not use directly, instead use {@link SponsorBlockSettings}
*/
public static final StringSetting SB_PRIVATE_USER_ID = new StringSetting("sb_private_user_id_Do_Not_Share", "");
public static final StringSetting DEPRECATED_SB_UUID_OLD_MIGRATION_SETTING = new StringSetting("uuid", ""); // Delete sometime in 2025
public static final StringSetting DEPRECATED_SB_UUID_OLD_MIGRATION_SETTING = new StringSetting("uuid", ""); // Delete sometime in early 2025
public static final IntegerSetting SB_CREATE_NEW_SEGMENT_STEP = new IntegerSetting("sb_create_new_segment_step", 150, parent(SB_ENABLED));
public static final BooleanSetting SB_VOTING_BUTTON = new BooleanSetting("sb_voting_button", FALSE, parent(SB_ENABLED));
public static final BooleanSetting SB_CREATE_NEW_SEGMENT = new BooleanSetting("sb_create_new_segment", FALSE, parent(SB_ENABLED));
Expand Down Expand Up @@ -337,9 +337,14 @@ public class Settings extends BaseSettings {
static {
// region Migration

// Do _not_ delete this SB private user id migration property until sometime in 2024.
// Do _not_ delete this SB private user id migration property until sometime in early 2025.
// This is the only setting that cannot be reconfigured if lost,
// and more time should be given for users who rarely upgrade.
SharedPrefCategory sbPrefs = new SharedPrefCategory("sponsor-block");
String key = DEPRECATED_SB_UUID_OLD_MIGRATION_SETTING.key
.substring(3); // Remove the "sb_" prefix, as old categories are saved without it.
migrateFromOldPreferences(sbPrefs, DEPRECATED_SB_UUID_OLD_MIGRATION_SETTING, key);

migrateOldSettingToNew(DEPRECATED_SB_UUID_OLD_MIGRATION_SETTING, SB_PRIVATE_USER_ID);

// endregion
Expand Down

0 comments on commit a673c74

Please sign in to comment.