mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(plex): selective user import (#2188)
* feat(api): allow importing of only selected Plex users * feat(frontend): modal for importing Plex users * feat: add alert if 'Enable New Plex Sign-In' setting is enabled * refactor: fetch all existing Plex users in a single DB query Co-authored-by: Ryan Cohen <ryan@sct.dev>
This commit is contained in:
@@ -400,6 +400,7 @@ router.post(
|
||||
try {
|
||||
const settings = getSettings();
|
||||
const userRepository = getRepository(User);
|
||||
const body = req.body as { plexIds: string[] } | undefined;
|
||||
|
||||
// taken from auth.ts
|
||||
const mainUser = await userRepository.findOneOrFail({
|
||||
@@ -434,7 +435,7 @@ router.post(
|
||||
user.plexId = parseInt(account.id);
|
||||
}
|
||||
await userRepository.save(user);
|
||||
} else {
|
||||
} else if (!body || body.plexIds.includes(account.id)) {
|
||||
if (await mainPlexTv.checkUserAccess(parseInt(account.id))) {
|
||||
const newUser = new User({
|
||||
plexUsername: account.username,
|
||||
|
Reference in New Issue
Block a user