From 471911750439620d675a5d7fd507d6e4ad773b0a Mon Sep 17 00:00:00 2001 From: William Mantly Date: Mon, 17 Nov 2025 13:34:35 -0500 Subject: [PATCH] Private session --- conf/base.js | 1 + controller/torrent.js | 10 +--- models/sql/torrent.js | 4 +- public/partial/header.html | 120 ++++++++++++++++++------------------- 4 files changed, 63 insertions(+), 72 deletions(-) diff --git a/conf/base.js b/conf/base.js index 75fae2a..9cd61b9 100644 --- a/conf/base.js +++ b/conf/base.js @@ -22,5 +22,6 @@ module.exports = { port: 9091, username: 'william', password: '__IN SRECREST FILE__', + statusUpdateInterval: 500, } }; diff --git a/controller/torrent.js b/controller/torrent.js index 6b175a5..de5e81c 100644 --- a/controller/torrent.js +++ b/controller/torrent.js @@ -2,8 +2,7 @@ const ps = require('./pubsub.js'); const {Torrent} = require('>/models'); - -console.log('here!!!!!!!!!!!!!') +const conf = require('>/conf'); let statusLock = false; setInterval(async function(){ @@ -17,9 +16,4 @@ setInterval(async function(){ // console.error('status interval error', error) } statusLock = false -}, 10000, statusLock); - - -// ps.subscribe(/./g, function(...args){ -// console.log('event', args); -// }); \ No newline at end of file +}, conf.transmission.statusUpdateInterval, statusLock); diff --git a/models/sql/torrent.js b/models/sql/torrent.js index e89de83..11f3682 100644 --- a/models/sql/torrent.js +++ b/models/sql/torrent.js @@ -36,9 +36,10 @@ module.exports = (sequelize, DataTypes, Model) => { // console.log('instance', instance) await this.build(data).validate(); // console.log('validate', val); + data.isPrivate = data.isPrivate === 'true' ? true : false; let options = { - 'download-dir': data.isPrivate === 'true' ? `${conf.privateDownloadLocation}/${data.added_by}` : undefined, + 'download-dir': data.isPrivate ? `${conf.privateDownloadLocation}/${data.added_by}` : undefined, }; let res = await tr_client.addUrl(data.magnetLink, options); @@ -46,6 +47,7 @@ module.exports = (sequelize, DataTypes, Model) => { return await super.create({ magnetLink: data.magnetLink, hashString: res.hashString, + isPrivate: data.isPrivate, name: res.name, added_by: data.added_by, status: 0, diff --git a/public/partial/header.html b/public/partial/header.html index 7fa1081..6f349d2 100644 --- a/public/partial/header.html +++ b/public/partial/header.html @@ -55,6 +55,8 @@
@@ -101,7 +103,6 @@