Skip to content

Commit

Permalink
fix(mt): seedingSzie pt-plugins#1762
Browse files Browse the repository at this point in the history
  • Loading branch information
fzlins authored and wegood9 committed Mar 24, 2024
1 parent 0e57ea1 commit 173e939
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
14 changes: 5 additions & 9 deletions resource/sites/xp.m-team.io/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,19 +285,15 @@
},
"userSeedingTorrents": {
"page": "/api/member/getUserTorrentList",
"parser": "getUserSeedingTorrents.js",
"dataType": "json",
"requestMethod": "POST",
"requestContentType": "application/json",
"requestData": {
"userid": "$user.id$",
"type": "SEEDING",
"pageNumber": "1",
"pageSize": "1"
},
"fields": {
"seeding": {
"selector": ["data.total"]
}
"pageNumber": 1,
"pageSize": 200
}
},
"userUploadedTorrents": {
Expand All @@ -308,8 +304,8 @@
"requestData": {
"userid": "$user.id$",
"type": "UPLOADED",
"pageNumber": "1",
"pageSize": "1"
"pageNumber": 1,
"pageSize": 1
},
"fields": {
"uploads": {
Expand Down
19 changes: 9 additions & 10 deletions resource/sites/xp.m-team.io/getUserSeedingTorrents.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
this.rawData = "";
this.pageInfo = {
count: 0,
current: 0,
size: 100
current: 0
};
this.result = {
uploads: 0,
uploadsSize: 0
seeding: 0,
seedingSize: 0
};
this.load();
}
Expand All @@ -32,18 +31,18 @@

let datas = this.rawData.data.data;
let results = {
uploads: 0,
uploadsSize: 0
seeding: 0,
seedingSize: 0
};
if (datas) {
datas.forEach(item => {
results.uploads++;
results.uploadsSize += item[0].size;
results.seeding++;
results.seedingSize += Number(item.torrent.size);
});
}

this.result.uploads += results.uploads;
this.result.uploadsSize += results.uploadsSize;
this.result.seeding += results.seeding;
this.result.seedingSize += results.seedingSize;

this.pageInfo.current++;
// 是否已到最后一页
Expand Down

0 comments on commit 173e939

Please sign in to comment.