From c6cc529d549f192d8cb34c61effbf73abad2b990 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Sun, 7 Jan 2024 01:37:19 -0500 Subject: [PATCH 1/2] completed torrents no longer ask transmission for update --- models/sql/torrent.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/sql/torrent.js b/models/sql/torrent.js index 8c238e1..40480d6 100644 --- a/models/sql/torrent.js +++ b/models/sql/torrent.js @@ -89,6 +89,9 @@ module.exports = (sequelize, DataTypes, Model) => { async getTorrentData(noUpdate){ try{ + + if(this.percentDone === 1) return this.dataValues + let res = ( await tr_client.get(this.hashString, [ "eta", "percentDone", "status", "rateDownload", "errorString", "hashString", 'name', @@ -103,9 +106,9 @@ module.exports = (sequelize, DataTypes, Model) => { 'sizeWhenDone', ]) ).torrents[0]; - if(this.percentDone === 1) return this.dataValues await this.update(res); if(noUpdate) await this.save(); + return {...res, ...this.dataValues}; }catch(error){ if(error.code === 'ECONNREFUSED'){ -- 2.34.1 From bbcd955f28b2ac6d6175ea5077973df35d465916 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Sun, 7 Jan 2024 01:37:43 -0500 Subject: [PATCH 2/2] Fixed issue where migrate deletes auth token --- public/partial/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/partial/header.html b/public/partial/header.html index a58aa63..4a2a810 100644 --- a/public/partial/header.html +++ b/public/partial/header.html @@ -537,7 +537,7 @@ } }); } - localStorage.clear('torrents'); + localStorage.removeItem('torrents',); } } -- 2.34.1