aboutsummaryrefslogtreecommitdiff
path: root/controllers/albumsController.js
diff options
context:
space:
mode:
authorPitu <[email protected]>2017-08-30 04:48:17 -0300
committerPitu <[email protected]>2017-08-30 04:48:17 -0300
commit80117235f9aca748a91c725b26210b081da88d6d (patch)
tree8055b21323bd41a84aa9d6f0b403599e2ff6501a /controllers/albumsController.js
parentUpdate README.md (diff)
downloadhost.fuwn.me-80117235f9aca748a91c725b26210b081da88d6d.tar.xz
host.fuwn.me-80117235f9aca748a91c725b26210b081da88d6d.zip
Added album check to uploads
Diffstat (limited to 'controllers/albumsController.js')
-rw-r--r--controllers/albumsController.js8
1 files changed, 4 insertions, 4 deletions
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'))