Skip to content

Commit

Permalink
added Resolution model
Browse files Browse the repository at this point in the history
  • Loading branch information
Yemeni committed Aug 23, 2020
1 parent 01c9de6 commit e5c4ba9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions controllers/backend/resolutionChange.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// this controller is still empty
17 changes: 17 additions & 0 deletions models/Resolution.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const mongoose = require('mongoose');
const _ = require('lodash');
const javascriptTimeAgo = require('javascript-time-ago');
javascriptTimeAgo.locale(require('javascript-time-ago/locales/en'));
require('javascript-time-ago/intl-messageformat-global');
require('intl-messageformat/dist/locale-data/en');

const resolutionSchema = new mongoose.Schema({

fileSize: Number,
resolution: { type: String, enum: ['240', '360', '480', '720', '1080'] },
originalUpload: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Upload'
}

});
5 changes: 5 additions & 0 deletions models/Upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const uploadSchema = new mongoose.Schema({
originalFileSizeInMb: Number,
processedFileSizeInMb: Number,
fileSize: Number, // TODO: should support highQualityFileSize as well for compressions
fileQuality: Array,
fileResolutions: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Resolution'
},
views: {
type: Number,
default: 0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "NodeTube",
"version": "1.0.0",
"version": "1.0.1",
"description": "Video, audio and image hosting",
"repository": {
"type": "git",
Expand Down

0 comments on commit e5c4ba9

Please sign in to comment.