2020-09-02 14:13:26 +00:00
|
|
|
import * as mongoose from 'mongoose';
|
2020-09-02 15:11:49 +00:00
|
|
|
import * as Int32 from 'mongoose-int32';
|
2020-09-02 14:13:26 +00:00
|
|
|
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
|
|
|
|
const Sample = new Schema({
|
|
|
|
start: {type: Int32, default: new Int32(0)},
|
|
|
|
length: {type: Int32, default: new Int32(0)}
|
|
|
|
});
|
|
|
|
|
|
|
|
const Chart = new Schema({
|
|
|
|
name: {type: String, default: ''},
|
|
|
|
rating: {type: Int32, default: new Int32(0)},
|
|
|
|
type: {type: String, default: 'Challenge'}
|
|
|
|
});
|
|
|
|
|
|
|
|
const FileSchema = new Schema({
|
|
|
|
title: {type: String, default: 'unknown'},
|
2020-09-02 14:40:24 +00:00
|
|
|
titleTranslit: String,
|
2020-09-02 14:13:26 +00:00
|
|
|
artist: {type: String, default: 'unknown'},
|
2020-09-02 14:40:24 +00:00
|
|
|
artistTranslit: String,
|
2020-09-02 14:13:26 +00:00
|
|
|
subtitle: String,
|
2020-09-02 14:40:24 +00:00
|
|
|
subtitleTranslit: String,
|
2020-09-02 14:13:26 +00:00
|
|
|
credit: String,
|
|
|
|
uploader: {type: String, default: '00000000-0000-4000-a000-000000000000'},
|
|
|
|
sample: Sample,
|
|
|
|
bpms: {type: [Number], default: 0},
|
|
|
|
charts: [Chart]
|
|
|
|
});
|
|
|
|
|
|
|
|
export const File = mongoose.model('File', FileSchema);
|