lib/common/media/entity/media-type.entity.ts
The entity stores the types of media objects
Properties |
code |
Type : string
|
Decorators :
@Index({unique: true})
|
ext |
Type : MediaExtEntity
|
Decorators :
@ManyToOne(undefined, e => e.code)
|
formats |
Type : MediaFormatEntity[]
|
Decorators :
@ManyToMany(undefined)
|
name |
Type : string
|
Decorators :
@Index()
|
private |
Type : boolean
|
Decorators :
@Column('boolean', {default: false})
|
quality |
Type : number
|
Decorators :
@Column('int', {nullable: true})
|
vp6 |
Type : boolean
|
Decorators :
@Column('boolean', {default: false})
|
import {
Column,
Entity,
Index,
JoinTable,
ManyToMany,
ManyToOne,
PrimaryColumn,
} from "typeorm";
import { MediaFormatEntity } from "./media-format.entity";
import { MediaType } from "../media.types";
import { MediaExtEntity } from "./media-ext.entity";
/**
* The entity stores the types of media objects
*/
@Entity("medias_types")
export class MediaTypeEntity implements MediaType {
@Index({ unique: true })
@PrimaryColumn("varchar")
code: string;
@Index()
@Column("varchar", { nullable: false })
name: string;
@Column("boolean", { default: false })
vp6: boolean;
@Column("boolean", { default: false })
private: boolean;
@Column("int", { nullable: true })
quality: number;
@ManyToOne(() => MediaExtEntity, (e) => e.code)
ext: MediaExtEntity;
@ManyToMany(() => MediaFormatEntity)
@JoinTable()
formats: MediaFormatEntity[];
}