seedlinux

find open source torrents and stats for people wishing to contribute bandwidth.
git clone git://git.beardyjay.co.uk/seedlinux
Log | Files | Refs | README | LICENSE

commit 2a17b9eebf04a0b63c12950b45474fc1227a3a09
parent 456fcf76a8e0bfd49a31ef29c28abd82c8dccfd9
Author: Jay Scott <jay@jayscott.co.uk>
Date:   Thu, 29 Jun 2017 00:13:54 +0100

WIP

Diffstat:
Mapp.js | 5+----
Mroutes/index.js | 2+-
Mroutes/parse.js | 21+++++++++++++++++++--
3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/app.js b/app.js @@ -30,20 +30,17 @@ app.use(function(req,res,next){ app.use('/', index); app.use('/parse/', parse); -// catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); -// error handler + app.use(function(err, req, res, next) { - // set locals, only providing error in development res.locals.message = err.message; res.locals.error = req.app.get('env') === 'development' ? err : {}; - // render the error page res.status(err.status || 500); res.render('error'); }); diff --git a/routes/index.js b/routes/index.js @@ -5,7 +5,7 @@ const express = require('express'); const router = express.Router(); /* GET home page. */ -router.get('/', (req, res, next) => { +router.get('/', (req, res) => { const collection = req.db.get(config.collection); collection.find({}, {}, (e, docs) => { diff --git a/routes/parse.js b/routes/parse.js @@ -14,12 +14,12 @@ const router = express.Router(); - Move to commandline tool instead of web route. - get seeders / leechers on first pass. */ -router.get('/', (req, res, next) => { +router.get('/', (req, res) => { const collection = req.db.get(config.collection); const torrentFolder = config.torrent_data; - fs.readdir(torrentFolder, (err, files, next) => { + fs.readdir(torrentFolder, (err, files) => { files.forEach(file => { let tFile = fs.readFileSync(torrentFolder + '/' + file); let tData = parseTorrent(tFile); @@ -52,4 +52,21 @@ router.get('/', (req, res, next) => { }); + +function getFiles() { + +} + +function getMetadata() { + +} + +function getMagnetLink() { + +} + +function updateDB() { + +} + module.exports = router;