Skip to content

Commit

Permalink
Remove migration for the legacy global sample rate option
Browse files Browse the repository at this point in the history
This was originally planned for version 1.65, so it's quite overdue.

Signed-off-by: Andrew Gunnerson <[email protected]>
  • Loading branch information
chenxiaolong committed Jan 1, 2025
1 parent 2a2c39e commit 0430707
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
15 changes: 0 additions & 15 deletions app/src/main/java/com/chiller3/bcr/Preferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Preferences(initialContext: Context) {
private const val PREF_FORMAT_PARAM_PREFIX = "codec_param_"
private const val PREF_FORMAT_SAMPLE_RATE_PREFIX = "codec_sample_rate_"
const val PREF_OUTPUT_RETENTION = "output_retention"
const val PREF_SAMPLE_RATE = "sample_rate"
private const val PREF_NEXT_NOTIFICATION_ID = "next_notification_id"
private const val PREF_ALREADY_MIGRATED = "already_migrated"

Expand Down Expand Up @@ -446,20 +445,6 @@ class Preferences(initialContext: Context) {
nextId
}

/**
* Migrate legacy global sample rate to format-specific sample rate.
*
* This migration will be removed in version 1.65.
*/
fun migrateSampleRate() {
val sampleRate = getOptionalUint(PREF_SAMPLE_RATE, UInt.MAX_VALUE)
if (sampleRate != null) {
val (format, _, _) = Format.fromPreferences(this)
setFormatSampleRate(format, sampleRate)
setOptionalUint(PREF_SAMPLE_RATE, UInt.MAX_VALUE, null)
}
}

/**
* Migrate legacy rules to modern rules.
*
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/chiller3/bcr/RecorderApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class RecorderApplication : Application() {

// Migrate legacy preferences.
val prefs = Preferences(this)
prefs.migrateSampleRate()
prefs.migrateLegacyRules()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class SettingsFragment : PreferenceBaseFragment(), Preference.OnPreferenceChange
refreshOutputDir()
}
// Update the output format state when it's changed by the bottom sheet.
Preferences.isFormatKey(key) || key == Preferences.PREF_SAMPLE_RATE -> {
Preferences.isFormatKey(key) -> {
refreshOutputFormat()
}
// Update when it's changed by the dialog.
Expand Down

0 comments on commit 0430707

Please sign in to comment.