mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-31 19:59:31 -05:00
feat: user avatars from plex (#53)
This commit is contained in:
@@ -27,6 +27,9 @@ export class User {
|
||||
@Column({ type: 'integer', default: 0 })
|
||||
public permissions = 0;
|
||||
|
||||
@Column()
|
||||
public avatar: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
public createdAt: Date;
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ components:
|
||||
permissions:
|
||||
type: number
|
||||
example: 0
|
||||
avatar:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
example: '2020-09-02T05:02:23.000Z'
|
||||
|
||||
@@ -46,6 +46,9 @@ authRoutes.post('/login', async (req, res) => {
|
||||
user.plexToken = body.authToken;
|
||||
await userRepository.save(user);
|
||||
}
|
||||
|
||||
// Update the users avatar with their plex thumbnail (incase it changed)
|
||||
user.avatar = account.thumb;
|
||||
} else {
|
||||
// Here we check if it's the first user. If it is, we create the user with no check
|
||||
// and give them admin permissions
|
||||
@@ -56,6 +59,7 @@ authRoutes.post('/login', async (req, res) => {
|
||||
email: account.email,
|
||||
plexToken: account.authToken,
|
||||
permissions: Permission.ADMIN,
|
||||
avatar: account.thumb,
|
||||
});
|
||||
await userRepository.save(user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user