diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-03-16 21:37:17 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-03-16 21:37:17 +0100 |
commit | 5101105ef91bfe478f97546b78b321882da2079c (patch) | |
tree | a3deec88917fecb8f4299c710bab9ba7679b4803 /server/lib | |
parent | 86e054b20fabb5934e09d0bcb096840dd28d69fd (diff) | |
download | PeerTube-5101105ef91bfe478f97546b78b321882da2079c.tar.gz PeerTube-5101105ef91bfe478f97546b78b321882da2079c.tar.zst PeerTube-5101105ef91bfe478f97546b78b321882da2079c.zip |
Video lib/model/reqvalidator refractoring
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/videos.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/lib/videos.js b/server/lib/videos.js index 3c6ee4a65..a5fe7b0c4 100644 --- a/server/lib/videos.js +++ b/server/lib/videos.js | |||
@@ -12,10 +12,21 @@ var Videos = require('../models/videos') | |||
12 | var uploadDir = path.join(__dirname, '..', '..', config.get('storage.uploads')) | 12 | var uploadDir = path.join(__dirname, '..', '..', config.get('storage.uploads')) |
13 | 13 | ||
14 | var videos = { | 14 | var videos = { |
15 | getVideoState: getVideoState, | ||
15 | seed: seed, | 16 | seed: seed, |
16 | seedAllExisting: seedAllExisting | 17 | seedAllExisting: seedAllExisting |
17 | } | 18 | } |
18 | 19 | ||
20 | function getVideoState (video, callback) { | ||
21 | var exist = (video !== null) | ||
22 | var owned = false | ||
23 | if (exist === true) { | ||
24 | owned = (video.namePath !== null) | ||
25 | } | ||
26 | |||
27 | return callback({ exist: exist, owned: owned }) | ||
28 | } | ||
29 | |||
19 | function seed (path, callback) { | 30 | function seed (path, callback) { |
20 | logger.info('Seeding %s...', path) | 31 | logger.info('Seeding %s...', path) |
21 | 32 | ||