completed torrents no longer ask transmission for update
This commit is contained in:
parent
1c7e2e794e
commit
c6cc529d54
@ -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'){
|
||||
|
Loading…
x
Reference in New Issue
Block a user