Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions server/lib/overseerrMerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,27 @@ const checkOverseerrMerge = async (): Promise<boolean> => {
await dbConnection.query('PRAGMA foreign_keys=ON');
}

// Fix corrupted quota values carried over from Overseerr
try {
await dbConnection.query(
`UPDATE user SET movieQuotaLimit = NULL WHERE typeof(movieQuotaLimit) = 'text'`
);
await dbConnection.query(
`UPDATE user SET movieQuotaDays = NULL WHERE typeof(movieQuotaDays) = 'text'`
);
await dbConnection.query(
`UPDATE user SET tvQuotaLimit = NULL WHERE typeof(tvQuotaLimit) = 'text'`
);
await dbConnection.query(
`UPDATE user SET tvQuotaDays = NULL WHERE typeof(tvQuotaDays) = 'text'`
);
} catch (error) {
logger.error('Failed to clean up corrupted quota values', {
label: 'Seerr Migration',
error: error.message,
});
}

// MediaStatus.Blacklisted was added before MediaStatus.Deleted in Jellyseerr
try {
const mediaRepository = getRepository(Media);
Expand Down
Loading