1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 18:02:44 +01:00

Fixed: Remove pre-DB from frontend storage

This commit is contained in:
Robin Dadswell 2022-02-21 14:15:32 +00:00 committed by Qstick
parent b1afd7aaaa
commit 7de270b212
2 changed files with 20 additions and 0 deletions

View File

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

View File

@ -0,0 +1,18 @@
import get from 'lodash';
export default function migratePreDbToReleased(persistedState) {
const addMovie = get(persistedState, 'addMovie.defaults.minimumAvailability');
const discoverMovie = get(persistedState, 'discoverMovie.defaults.minimumAvailability');
if (!addMovie && !discoverMovie) {
return;
}
if (addMovie === 'preDB') {
persistedState.addMovie.defaults.minimumAvailability = 'released';
}
if (discoverMovie === 'preDB') {
persistedState.discoverMovie.defaults.minimumAvailability = 'released';
}
}