mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2026-01-01 04:08:45 -05:00
fix(settingsmigrator): prevent region migration from running multiple times (#1255)
Adds a guard clause to skip region migration if discoverRegion and streamingRegion properties already exist in settings. This prevents accidental overwrites of existing region settings during multiple runs and ensures the migration only executes when needed. Previously, the migration would run every time regardless of whether the new region properties existed, potentially overwriting user preferences. fix #1251
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import type { AllSettings } from '@server/lib/settings';
|
||||
|
||||
const migrateRegionSetting = (settings: any): AllSettings => {
|
||||
if (
|
||||
settings.main.discoverRegion !== undefined &&
|
||||
settings.main.streamingRegion !== undefined
|
||||
) {
|
||||
return settings;
|
||||
}
|
||||
|
||||
const oldRegion = settings.main.region;
|
||||
if (oldRegion) {
|
||||
settings.main.discoverRegion = oldRegion;
|
||||
|
||||
Reference in New Issue
Block a user