mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-23 00:03:05 +00:00
Fixed: Sorting by timeleft on Activity: Queue
This commit is contained in:
parent
346d7f3cf4
commit
ea19020015
1 changed files with 15 additions and 1 deletions
|
@ -3,6 +3,7 @@ var PageableCollection = require('backbone.pageable');
|
|||
var QueueModel = require('./QueueModel');
|
||||
var FormatHelpers = require('../../Shared/FormatHelpers');
|
||||
var AsSortedCollection = require('../../Mixins/AsSortedCollection');
|
||||
var moment = require('moment');
|
||||
|
||||
require('../../Mixins/backbone.signalr.mixin');
|
||||
|
||||
|
@ -11,7 +12,8 @@ var QueueCollection = PageableCollection.extend({
|
|||
model : QueueModel,
|
||||
|
||||
state : {
|
||||
pageSize : 15
|
||||
pageSize : 15,
|
||||
sortKey: 'timeleft'
|
||||
},
|
||||
|
||||
mode : 'client',
|
||||
|
@ -45,6 +47,18 @@ var QueueCollection = PageableCollection.extend({
|
|||
|
||||
return episode.get('title');
|
||||
}
|
||||
},
|
||||
|
||||
timeleft : {
|
||||
sortValue : function(model, attr) {
|
||||
var eta = model.get('estimatedCompletionTime');
|
||||
|
||||
if (eta) {
|
||||
return moment(eta).unix();
|
||||
}
|
||||
|
||||
return Number.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue