Parcourir la source

merge https://github.com/mayswind/AriaNg/commit/0c5a6ce76baf8e33655d70aabfbc3e510e7595ca

MaysWind il y a 6 ans
Parent
commit
dc789faa6f

+ 2 - 0
app/langs/zh_Hans.txt

@@ -54,6 +54,8 @@ Filters=过滤器
 Download=下载
 Upload=上传
 Downloading=正在下载
+Pending Verification=等待验证
+Verifying=正在验证
 Seeding=正在做种
 Waiting=正在等待
 Paused=已暂停

+ 2 - 0
app/langs/zh_Hant.txt

@@ -54,6 +54,8 @@ Filters=篩選器
 Download=下載
 Upload=上傳
 Downloading=正在下載
+Pending Verification=等待驗證
+Verifying=正在驗證
 Seeding=正在做種
 Waiting=正在等待
 Paused=已暫停

+ 2 - 0
app/scripts/config/defaultLanguage.js

@@ -58,6 +58,8 @@
             'Download': 'Download',
             'Upload': 'Upload',
             'Downloading': 'Downloading',
+            'Pending Verification': 'Pending Verification',
+            'Verifying': 'Verifying',
             'Seeding': 'Seeding',
             'Waiting': 'Waiting',
             'Paused': 'Paused',

+ 8 - 0
app/scripts/controllers/list.js

@@ -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 {

+ 5 - 1
app/scripts/filters/taskStatus.js

@@ -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';

+ 3 - 1
app/scripts/services/aria2RpcService.js

@@ -280,7 +280,9 @@
                     'numSeeders',
                     'seeder',
                     'status',
-                    'errorCode'
+                    'errorCode',
+                    'verifiedLength',
+                    'verifyIntegrityPending'
                 ];
             },
             getFullTaskParams: function () {

+ 2 - 2
app/views/list.html

@@ -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}}">