mirror of https://github.com/Radarr/Radarr
parent
8a84975954
commit
64f27bca4f
|
@ -1,7 +1,9 @@
|
||||||
import migrateBlacklistToBlocklist from './migrateBlacklistToBlocklist';
|
import migrateBlacklistToBlocklist from './migrateBlacklistToBlocklist';
|
||||||
|
import migrateMonitorToEnum from './migrateMonitorToEnum';
|
||||||
import migratePreDbToReleased from './migratePreDbToReleased';
|
import migratePreDbToReleased from './migratePreDbToReleased';
|
||||||
|
|
||||||
export default function migrate(persistedState) {
|
export default function migrate(persistedState) {
|
||||||
migrateBlacklistToBlocklist(persistedState);
|
migrateBlacklistToBlocklist(persistedState);
|
||||||
migratePreDbToReleased(persistedState);
|
migratePreDbToReleased(persistedState);
|
||||||
|
migrateMonitorToEnum(persistedState);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,23 +4,19 @@ export default function migrateMonitorToEnum(persistedState) {
|
||||||
const addMovie = get(persistedState, 'addMovie.defaults.monitor');
|
const addMovie = get(persistedState, 'addMovie.defaults.monitor');
|
||||||
const discoverMovie = get(persistedState, 'discoverMovie.defaults.monitor');
|
const discoverMovie = get(persistedState, 'discoverMovie.defaults.monitor');
|
||||||
|
|
||||||
if (!addMovie && !discoverMovie) {
|
if (addMovie != null) {
|
||||||
return;
|
if (addMovie) {
|
||||||
|
persistedState.addMovie.defaults.monitor = 'movieOnly';
|
||||||
|
} else {
|
||||||
|
persistedState.addMovie.defaults.monitor = 'none';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addMovie === true) {
|
if (discoverMovie != null) {
|
||||||
persistedState.addMovie.defaults.monitor = 'movieOnly';
|
if (discoverMovie) {
|
||||||
}
|
persistedState.discoverMovie.defaults.monitor = 'movieOnly';
|
||||||
|
} else {
|
||||||
if (discoverMovie === true) {
|
persistedState.discoverMovie.defaults.monitor = 'none';
|
||||||
persistedState.discoverMovie.defaults.monitor = 'movieOnly';
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (addMovie === false) {
|
|
||||||
persistedState.addMovie.defaults.monitor = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (discoverMovie === false) {
|
|
||||||
persistedState.discoverMovie.defaults.monitor = 'none';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue