mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
improving bigint parsing
This commit is contained in:
parent
ec777bade6
commit
b387eeb7c9
@ -36,7 +36,7 @@ export class DirectoryEntity implements DirectoryDTO {
|
||||
*/
|
||||
@Column({
|
||||
type: 'bigint', nullable: true, unsigned: true, transformer: {
|
||||
from: v => parseInt(v, 10),
|
||||
from: v => parseInt(v, 10) || null,
|
||||
to: v => v
|
||||
}
|
||||
})
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Column, Entity, ChildEntity} from 'typeorm';
|
||||
import { MediaEntity, MediaMetadataEntity} from './MediaEntity';
|
||||
import {ChildEntity, Column} from 'typeorm';
|
||||
import {MediaEntity, MediaMetadataEntity} from './MediaEntity';
|
||||
import {VideoDTO, VideoMetadata} from '../../../../common/entities/VideoDTO';
|
||||
|
||||
|
||||
@ -8,7 +8,12 @@ export class VideoMetadataEntity extends MediaMetadataEntity implements VideoMet
|
||||
@Column('int')
|
||||
bitRate: number;
|
||||
|
||||
@Column('bigint')
|
||||
@Column('bigint', {
|
||||
unsigned: true, nullable: true, transformer: {
|
||||
from: v => parseInt(v, 10) || null,
|
||||
to: v => v
|
||||
}
|
||||
})
|
||||
duration: number;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user