Fixed: Run Frontend Migration for MonitorType

FIxes #7314
This commit is contained in:
Qstick 2022-05-29 09:03:56 -05:00
parent 8a84975954
commit 64f27bca4f
2 changed files with 14 additions and 16 deletions

View File

@ -1,7 +1,9 @@
import migrateBlacklistToBlocklist from './migrateBlacklistToBlocklist';
import migrateMonitorToEnum from './migrateMonitorToEnum';
import migratePreDbToReleased from './migratePreDbToReleased';
export default function migrate(persistedState) {
migrateBlacklistToBlocklist(persistedState);
migratePreDbToReleased(persistedState);
migrateMonitorToEnum(persistedState);
}

View File

@ -4,23 +4,19 @@ export default function migrateMonitorToEnum(persistedState) {
const addMovie = get(persistedState, 'addMovie.defaults.monitor');
const discoverMovie = get(persistedState, 'discoverMovie.defaults.monitor');
if (!addMovie && !discoverMovie) {
return;
if (addMovie != null) {
if (addMovie) {
persistedState.addMovie.defaults.monitor = 'movieOnly';
} else {
persistedState.addMovie.defaults.monitor = 'none';
}
}
if (addMovie === true) {
persistedState.addMovie.defaults.monitor = 'movieOnly';
}
if (discoverMovie === true) {
persistedState.discoverMovie.defaults.monitor = 'movieOnly';
}
if (addMovie === false) {
persistedState.addMovie.defaults.monitor = 'none';
}
if (discoverMovie === false) {
persistedState.discoverMovie.defaults.monitor = 'none';
if (discoverMovie != null) {
if (discoverMovie) {
persistedState.discoverMovie.defaults.monitor = 'movieOnly';
} else {
persistedState.discoverMovie.defaults.monitor = 'none';
}
}
}