1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Video lib/model/reqvalidator refractoring

This commit is contained in:
Chocobozzz 2016-03-16 21:37:17 +01:00
parent 86e054b20f
commit 5101105ef9
3 changed files with 23 additions and 41 deletions

View file

@ -12,10 +12,21 @@ var Videos = require('../models/videos')
var uploadDir = path.join(__dirname, '..', '..', config.get('storage.uploads'))
var videos = {
getVideoState: getVideoState,
seed: seed,
seedAllExisting: seedAllExisting
}
function getVideoState (video, callback) {
var exist = (video !== null)
var owned = false
if (exist === true) {
owned = (video.namePath !== null)
}
return callback({ exist: exist, owned: owned })
}
function seed (path, callback) {
logger.info('Seeding %s...', path)