mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-27 11:05:13 +02:00
34 lines
1015 B
TypeScript
34 lines
1015 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { PluginSettings } from 'plugins/plugin-types';
|
|
import { User } from 'src/users/user.entity';
|
|
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm';
|
|
|
|
@Entity()
|
|
export class MediaSource {
|
|
@ApiProperty({ required: true, type: 'string' })
|
|
@PrimaryColumn()
|
|
id: string;
|
|
|
|
@ApiProperty({ required: true, type: 'string' })
|
|
@PrimaryColumn()
|
|
userId: string;
|
|
|
|
@ApiProperty({ required: true, type: 'string' })
|
|
@ManyToOne(() => User, (user) => user.mediaSources)
|
|
@JoinColumn({ name: 'userId' })
|
|
user: User;
|
|
|
|
@ApiProperty({ required: false, type: 'boolean', default: false })
|
|
@Column({ default: false })
|
|
enabled: boolean = false;
|
|
|
|
@ApiProperty({ required: false, type: 'boolean', default: false })
|
|
@Column({ default: false })
|
|
adminControlled: boolean;
|
|
|
|
@ApiProperty({ required: false, type: 'object' })
|
|
@Column('json', { default: '{}' })
|
|
pluginSettings: PluginSettings = {};
|
|
// Add other fields as necessary
|
|
}
|