From cf4528a2bda89c687b0e31ad1312a34b808f5ca8 Mon Sep 17 00:00:00 2001 From: kraiz Date: Mon, 30 Mar 2015 22:06:48 +0200 Subject: [PATCH] best guess for #17, need to test --- app/js/services/rpc.js | 14 +++++++++++++- app/partials/queue.html | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/js/services/rpc.js b/app/js/services/rpc.js index 960d4a4..79557ec 100644 --- a/app/js/services/rpc.js +++ b/app/js/services/rpc.js @@ -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}); diff --git a/app/partials/queue.html b/app/partials/queue.html index 64b9d06..92b2fa9 100644 --- a/app/partials/queue.html +++ b/app/partials/queue.html @@ -9,7 +9,7 @@ - + {{ item.Filename }}