2
0
mirror of https://github.com/thumbsup/thumbsup synced 2024-11-11 07:10:26 +00:00
thumbsup/test/fixtures.js

34 lines
686 B
JavaScript

const Media = require('../src/model/media')
exports.file = function (opts) {
opts = opts || {}
return {
path: opts.path || 'path/image.jpg',
date: opts.date ? new Date(opts.date).getTime() : new Date().getTime(),
type: opts.type || 'image',
meta: {
SourceFile: 'path/image.jpg',
File: {},
EXIF: {},
IPTC: {},
XMP: {}
}
}
}
exports.date = function (str) {
return new Date(Date.parse(str))
}
exports.photo = function (opts) {
opts = opts || {}
opts.type = 'image'
return new Media(exports.file(opts))
}
exports.video = function (opts) {
opts = opts || {}
opts.type = 'video'
return new Media(exports.file(opts))
}