Introduction
Introduction Statistics Contact Development Disclaimer Help
WIP - seedlinux - Torrent indexing tool opensource torrents with share ratio's …
Log
Files
Refs
README
---
commit 231870fba89f2a4082e2433ca3cb6cbd610db745
parent 03b00f371837d317e702ec2a6817ce687f4f5840
Author: Jay Scott <[email protected]>
Date: Thu, 29 Jun 2017 00:13:54 +0100
WIP
Diffstat:
M app.js | 5 +----
M routes/index.js | 2 +-
M routes/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;
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.