mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(plex): do not fail to import Plex users when Plex Home has managed users (#1699)
* fix(plex): do not fail to import Plex users when Plex Home has managed users * fix: default display name to email when user has no username also, do not set username or plexUsername when it is the same as the user's email address * fix(ui): user display name placeholder should reflect fallback logic if username is not set * fix(ui): hide email addresses of other users if logged-in user does not have Manage Users permission * fix: always set Plex username even if same as user's email * fix: remove unnecessary permission check * fix: transform email addresses to lowercase
This commit is contained in:
@@ -48,11 +48,17 @@ export class User {
|
||||
@PrimaryGeneratedColumn()
|
||||
public id: number;
|
||||
|
||||
@Column({ unique: true })
|
||||
@Column({
|
||||
unique: true,
|
||||
transformer: {
|
||||
from: (value: string): string => value.toLowerCase(),
|
||||
to: (value: string): string => value.toLowerCase(),
|
||||
},
|
||||
})
|
||||
public email: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
public plexUsername: string;
|
||||
public plexUsername?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
public username?: string;
|
||||
@@ -220,7 +226,7 @@ export class User {
|
||||
|
||||
@AfterLoad()
|
||||
public setDisplayName(): void {
|
||||
this.displayName = this.username || this.plexUsername;
|
||||
this.displayName = this.username || this.plexUsername || this.email;
|
||||
}
|
||||
|
||||
public async getQuota(): Promise<QuotaResponse> {
|
||||
|
Reference in New Issue
Block a user