mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Sorting by timeleft on Activity: Queue
This commit is contained in:
parent
346d7f3cf4
commit
ea19020015
@ -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 New Issue
Block a user