feat: Overseerr to Jellyseerr migration (#2019)

* feat: add Overseerr migration

* refactor: rename to Seerr

* refactor: more rename to Seerr

* feat: update the value of the MediaStatus.DELETED enum

* fix: add more details in migration logs

* fix: replace .update by .save for TypeORM hooks

* fix: add fake migration to skip the duplicated UpdateWebPush migration

* fix: rewrite the AddUserAvatarCacheFields migration for Overseerr merge

* fix: replace jellyseerr migrations with a dedicated one for overseerr

* fix: update overseerr migration

* fix: update overseerr migration

* fix: remove irrelevant changes

* fix: typos

* docs: update jsdoc comment

* docs: update seerr description

* docs: fix the contributing.md link

* fix: remove unwanterd change on postgres dev datasource

* docs: add latest tag to docker image

* fix: migrate old deleted status for 4k media

* fix: update Seerr version check
This commit is contained in:
Gauthier
2025-10-30 19:57:50 +01:00
committed by GitHub
parent 2e6e9ad657
commit 4e9c94c80f
60 changed files with 942 additions and 395 deletions

View File

@@ -764,9 +764,13 @@ class Settings {
* This will load settings from file unless an optional argument of the object structure
* is passed in.
* @param overrideSettings If passed in, will override all existing settings with these
* @param raw If true, will load the settings without running migrations or generating missing
* values
*/
public async load(overrideSettings?: AllSettings): Promise<Settings> {
public async load(
overrideSettings?: AllSettings,
raw = false
): Promise<Settings> {
if (overrideSettings) {
this.data = overrideSettings;
return this;
@@ -779,10 +783,12 @@ class Settings {
await this.save();
}
if (data) {
if (data && !raw) {
const parsedJson = JSON.parse(data);
const migratedData = await runMigrations(parsedJson, SETTINGS_PATH);
this.data = merge(this.data, migratedData);
} else if (data) {
this.data = JSON.parse(data);
}
// generate keys and ids if it's missing

View File

@@ -46,7 +46,7 @@ export const runMigrations = async (
} catch (e) {
// we stop Seerr if the migration failed
logger.error(
`Error while running migration '${migration}': ${e.message}`,
`Error while running migration '${migration}': ${e.message}\n${e.stack}`,
{
label: 'Settings Migrator',
}