Skip to content

Commit

Permalink
add verifying and pending verification status
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed Apr 22, 2019
1 parent 1b3067c commit 0c5a6ce
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/langs/zh_Hans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Filters=过滤器
Download=下载
Upload=上传
Downloading=正在下载
Pending Verification=等待验证
Verifying=正在验证
Seeding=正在做种
Waiting=正在等待
Paused=已暂停
Expand Down
2 changes: 2 additions & 0 deletions src/langs/zh_Hant.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Filters=篩選器
Download=下載
Upload=上傳
Downloading=正在下載
Pending Verification=等待驗證
Verifying=正在驗證
Seeding=正在做種
Waiting=正在等待
Paused=已暫停
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/config/defaultLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
'Download': 'Download',
'Upload': 'Upload',
'Downloading': 'Downloading',
'Pending Verification': 'Pending Verification',
'Verifying': 'Verifying',
'Seeding': 'Seeding',
'Waiting': 'Waiting',
'Paused': 'Paused',
Expand Down
8 changes: 8 additions & 0 deletions src/scripts/controllers/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
$rootScope.taskContext.list = taskList;
needRequestWholeInfo = false;
} else {
if ($rootScope.taskContext.list && $rootScope.taskContext.list.length > 0) {
for (var i = 0; i < $rootScope.taskContext.list.length; i++) {
var task = $rootScope.taskContext.list[i];
delete task.verifiedLength;
delete task.verifyIntegrityPending;
}
}

if (ariaNgCommonService.extendArray(taskList, $rootScope.taskContext.list, 'gid')) {
needRequestWholeInfo = false;
} else {
Expand Down
6 changes: 5 additions & 1 deletion src/scripts/filters/taskStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
}

if (task.status === 'active') {
if (task.seeder === true || task.seeder === 'true') {
if (task.verifyIntegrityPending) {
return 'Pending Verification';
} else if (task.verifiedLength) {
return 'Verifying';
} else if (task.seeder === true || task.seeder === 'true') {
return 'Seeding';
} else {
return 'Downloading';
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/services/aria2RpcService.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@
'numSeeders',
'seeder',
'status',
'errorCode'
'errorCode',
'verifiedLength',
'verifyIntegrityPending'
];
},
getFullTaskParams: function () {
Expand Down
4 changes: 2 additions & 2 deletions src/views/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
<span class="task-last-time"
ng-bind="task.status === 'waiting' ? '--:--:--' : (task.status === 'paused' ? '' : (task.status === 'active' ? ((0 <= task.remainTime && task.remainTime < 86400) ? (task.remainTime | dateDuration: 'second': 'HH:mm:ss') : ('More Than One Day' | translate)) : ''))"></span>
<span class="task-download-speed visible-xs-inline pull-right"
ng-bind="(task.status === 'active' ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode}))"></span>
ng-bind="(task.status === 'active' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode}))"></span>
<span class="task-seeders pull-right" ng-bind="task.status === 'active' ? ((task.numSeeders ? (task.numSeeders + '/') : '') + task.connections) : ''"></span>
</div>
</div>
<div class="col-md-2 col-sm-2 hidden-xs">
<span class="task-download-speed" title="{{task.status === 'active' ? (('Download Speed' | translate) + ': ' + (task.downloadSpeed | readableVolume) + '/s') + (task.bittorrent ? ', ' + ('Upload Speed' | translate) + ': ' + (task.uploadSpeed | readableVolume) + '/s' : '') : ''}}"
ng-bind="(task.status === 'active' ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode}))"></span>
ng-bind="(task.status === 'active' && !task.verifyIntegrityPending && !task.verifiedLength ? (!task.seeder || task.downloadSpeed > 0 ? (task.downloadSpeed | readableVolume) + '/s' : '-') : (task | taskStatus: true | translate: {errorcode: task.errorCode}))"></span>
</div>
<div class="task-right-arrow visible-md visible-lg">
<a ng-href="#!/task/detail/{{task.gid}}" title="{{'Click to view task detail' | translate}}">
Expand Down

0 comments on commit 0c5a6ce

Please sign in to comment.