mirror of
https://github.com/agregarr/agregarr.git
synced 2026-01-14 17:34:53 +08:00
51 lines
993 B
TypeScript
51 lines
993 B
TypeScript
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
PrimaryColumn,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
export interface SourceColorScheme {
|
|
primaryColor: string;
|
|
secondaryColor: string;
|
|
textColor: string;
|
|
}
|
|
|
|
@Entity()
|
|
export class SourceColors {
|
|
constructor(init?: Partial<SourceColors>) {
|
|
Object.assign(this, init);
|
|
}
|
|
|
|
@PrimaryColumn()
|
|
public sourceType: string; // 'trakt', 'tmdb', 'imdb', etc.
|
|
|
|
@Column()
|
|
public primaryColor: string;
|
|
|
|
@Column()
|
|
public secondaryColor: string;
|
|
|
|
@Column()
|
|
public textColor: string;
|
|
|
|
@Column({ default: false })
|
|
public isDefault: boolean; // True for system defaults, false for user customizations
|
|
|
|
@CreateDateColumn()
|
|
public createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
public updatedAt: Date;
|
|
|
|
// Helper method to get color scheme
|
|
public getColorScheme(): SourceColorScheme {
|
|
return {
|
|
primaryColor: this.primaryColor,
|
|
secondaryColor: this.secondaryColor,
|
|
textColor: this.textColor,
|
|
};
|
|
}
|
|
}
|