Skip to content

Commit

Permalink
best guess for #17, need to test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraiz committed Mar 30, 2015
1 parent 9e605b5 commit cf4528a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion app/js/services/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,19 @@ angular.module('EiskaltRPC', []).factory('EiskaltRPC', function($http, $q) {
return jsonrpc('queue.listtargets', {separator: '┴'}, true);
},
ListQueue: function() {
return jsonrpc('queue.list');
const priorityOrder = ['Paused', 'Lowest', 'Low', 'Normal', 'High', 'Highest'];
var deferred = $q.defer();
var promise = deferred.promise;
jsonrpc('queue.list').success(function(queue) {
var result = [];
angular.forEach(queue, function(value) {
value.PriorityOrder = priorityOrder.indexOf(value.Priority);
this.push(value);
}, result);
deferred.resolve(result);
});
promise.success = promise.then;
return promise;
},
ClearSearchResults: function(huburl) {
return jsonrpc('search.clear', {huburl: huburl});
Expand Down
2 changes: 1 addition & 1 deletion app/partials/queue.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="(key, item) in queue" ng-controller="QueueItemCtrl">
<tr ng-repeat="item in queue | orderBy:['PriorityOrder','Filename']" ng-controller="QueueItemCtrl">
<td>
{{ item.Filename }}
<div collapse="!collapsed">
Expand Down

0 comments on commit cf4528a

Please sign in to comment.