New: Filter history by event (all/grabbed/imported/failed)

This commit is contained in:
Mark McDowall
2014-02-24 18:50:09 -08:00
parent ccedf07d54
commit 90a6bcaa47
6 changed files with 86 additions and 13 deletions
+11 -2
View File
@@ -3,8 +3,9 @@ define(
[
'History/HistoryModel',
'backbone.pageable',
'Mixins/AsFilteredCollection',
'Mixins/AsPersistedStateCollection'
], function (HistoryModel, PageableCollection, AsPersistedStateCollection) {
], function (HistoryModel, PageableCollection, AsFilteredCollection, AsPersistedStateCollection) {
var collection = PageableCollection.extend({
url : window.NzbDrone.ApiRoot + '/history',
model: HistoryModel,
@@ -27,6 +28,13 @@ define(
}
},
filterModes: {
'all' : [null, null],
'grabbed' : ['eventType', '1'],
'imported' : ['eventType', '3'],
'failed' : ['eventType', '4']
},
initialize: function (options) {
delete this.queryParams.episodeId;
@@ -50,5 +58,6 @@ define(
}
});
return AsPersistedStateCollection.apply(collection);
collection = AsFilteredCollection.call(collection);
return AsPersistedStateCollection.call(collection);
});