mirror of
https://github.com/thumbsup/thumbsup
synced 2024-11-17 15:25:50 +00:00
46 lines
880 B
JavaScript
46 lines
880 B
JavaScript
var File = require('../src/model/file');
|
|
|
|
exports.metadata = function() {
|
|
return {
|
|
fileDate: new Date(),
|
|
mediaType: 'photo',
|
|
exif: {
|
|
date: null,
|
|
orientation: 1,
|
|
caption: ''
|
|
}
|
|
};
|
|
};
|
|
|
|
exports.date = function(str) {
|
|
return new Date(Date.parse(str));
|
|
};
|
|
|
|
exports.photo = function(opts) {
|
|
opts = opts || {};
|
|
var date = opts.date ? new Date(Date.parse(opts.date)) : new Date();
|
|
return new File(opts.path || 'tmp', {
|
|
fileDate: date,
|
|
mediaType: 'photo',
|
|
exif: {
|
|
date: null,
|
|
orientation: 1,
|
|
caption: ''
|
|
}
|
|
});
|
|
};
|
|
|
|
exports.video = function(opts) {
|
|
opts = opts || {};
|
|
var date = opts.date ? new Date(Date.parse(opts.date)) : new Date();
|
|
return new File(opts.path || 'tmp', {
|
|
fileDate: date,
|
|
mediaType: 'video',
|
|
exif: {
|
|
date: null,
|
|
orientation: 1,
|
|
caption: ''
|
|
}
|
|
});
|
|
};
|