lib/common/file/entity/audio-file-metadata.entity.ts
The entity stores the audio metadata of the file
Properties |
album |
Type : string
|
Decorators :
@Index()
|
artist |
Type : string
|
Decorators :
@Index()
|
bitrate |
Type : number
|
Decorators :
@Index()
|
codec |
Type : string
|
Decorators :
@Index()
|
codecProfile |
Type : string
|
Decorators :
@Index()
|
container |
Type : string
|
Decorators :
@Index()
|
duration |
Type : number
|
Decorators :
@Index()
|
genre |
Type : string
|
Decorators :
@Index()
|
id |
Type : number
|
Decorators :
@PrimaryGeneratedColumn({zerofill: true})
|
label |
Type : string
|
Decorators :
@Index()
|
numberOfChannels |
Type : number
|
Decorators :
@Index()
|
sampleRate |
Type : number
|
Decorators :
@Index()
|
title |
Type : string
|
Decorators :
@Index()
|
tool |
Type : string
|
Decorators :
@Index()
|
year |
Type : number
|
Decorators :
@Index()
|
import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
import { AudioFileMetadata } from "../file.types";
/**
* The entity stores the audio metadata of the file
*/
@Entity("file_metadata_audio")
export class AudioFileMetadataEntity implements AudioFileMetadata {
@PrimaryGeneratedColumn({ zerofill: true })
id: number;
@Index()
@Column("varchar", { nullable: true })
container: string;
@Index()
@Column("varchar", { nullable: true })
codec: string;
@Index()
@Column("int", { name: "sample_rate", nullable: true })
sampleRate: number;
@Index()
@Column("int", { name: "number_of_channels", nullable: true })
numberOfChannels: number;
@Index()
@Column("int", { nullable: true })
bitrate: number;
@Index()
@Column("varchar", { name: "codec_profile", nullable: true })
codecProfile: string;
@Index()
@Column("varchar", { nullable: true })
tool: string;
@Index()
@Column("decimal", {
nullable: true,
default: null,
precision: 15,
scale: 10,
})
duration: number;
@Index()
@Column("varchar", { nullable: true })
title: string;
@Index()
@Column("varchar", { nullable: true })
artist: string;
@Index()
@Column("varchar", { nullable: true })
album: string;
@Index()
@Column("int", { nullable: true })
year: number;
@Index()
@Column("varchar", { nullable: true })
genre: string;
@Index()
@Column("varchar", { nullable: true })
label: string;
}