diff options
| author | Pitu <[email protected]> | 2017-01-18 04:05:56 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-01-18 04:05:56 -0300 |
| commit | 0dcaf36332cfa79f198a0cce04a1789822acd1ca (patch) | |
| tree | d0d5871a58f79d022b7abdd4a1661fd4a5f980eb /controllers/albumsController.js | |
| parent | lowercased headers (diff) | |
| download | host.fuwn.me-0dcaf36332cfa79f198a0cce04a1789822acd1ca.tar.xz host.fuwn.me-0dcaf36332cfa79f198a0cce04a1789822acd1ca.zip | |
Added browsing galleries from dashboard
Diffstat (limited to 'controllers/albumsController.js')
| -rw-r--r-- | controllers/albumsController.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/controllers/albumsController.js b/controllers/albumsController.js index 72c8177..76129ec 100644 --- a/controllers/albumsController.js +++ b/controllers/albumsController.js @@ -15,6 +15,9 @@ albumsController.list = function(req, res, next){ db.table('albums').select(fields).then((albums) => { + if(req.headers.extended === undefined) + return res.json({ success: true, albums }) + let ids = [] for(let album of albums){ album.date = new Date(album.timestamp * 1000) @@ -23,9 +26,6 @@ albumsController.list = function(req, res, next){ ids.push(album.id) } - if(req.headers.extended === undefined) - return res.json({ success: true, albums }) - db.table('files').whereIn('albumid', ids).select('albumid').then((files) => { let albumsCount = {} |