From 80117235f9aca748a91c725b26210b081da88d6d Mon Sep 17 00:00:00 2001 From: Pitu <7425261+Pitu@users.noreply.github.com> Date: Wed, 30 Aug 2017 04:48:17 -0300 Subject: Added album check to uploads --- controllers/albumsController.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'controllers/albumsController.js') diff --git a/controllers/albumsController.js b/controllers/albumsController.js index 3a51e15..a8dcb96 100644 --- a/controllers/albumsController.js +++ b/controllers/albumsController.js @@ -75,12 +75,12 @@ albumsController.create = function(req, res, next) { }).then((album) => { if (album.length !== 0) return res.json({ success: false, description: 'There\'s already an album with that name' }) - db.table('albums').insert({ - name: name, + db.table('albums').insert({ + name: name, enabled: 1, userid: user[0].id, identifier: randomstring.generate(8), - timestamp: Math.floor(Date.now() / 1000) + timestamp: Math.floor(Date.now() / 1000) }).then(() => { return res.json({ success: true }) }) @@ -144,7 +144,7 @@ albumsController.get = function(req, res, next) { let title = albums[0].name db.table('files').select('name').where('albumid', albums[0].id).orderBy('id', 'DESC').then((files) => { - + let basedomain = req.get('host') for (let domain of config.domains) if (domain.host === req.get('host')) -- cgit v1.2.3