Repurposed the Missing page to include filter options and display episodes that haven't reached cutoff.

--HG--
rename : src/NzbDrone.Api/Missing/MissingModule.cs => src/NzbDrone.Api/Wanted/MissingModule.cs
rename : src/UI/Missing/ControlsColumnTemplate.html => src/UI/Wanted/ControlsColumnTemplate.html
rename : src/UI/Missing/MissingCollection.js => src/UI/Wanted/Missing/MissingCollection.js
rename : src/UI/Missing/MissingLayout.js => src/UI/Wanted/WantedLayout.js
rename : src/UI/Missing/MissingLayoutTemplate.html => src/UI/Wanted/WantedLayoutTemplate.html
extra : source : 2c76f3e423d39446f3bd7799b7344d7be63c70f5
This commit is contained in:
Taloth Saldono
2014-02-09 20:03:49 +01:00
committed by Mark McDowall
parent 935c26d03e
commit d416dd4177
23 changed files with 596 additions and 62 deletions

View File

@@ -0,0 +1,54 @@
'use strict';
define(
[
'underscore',
'Series/EpisodeModel',
'backbone.pageable',
'Mixins/AsFilteredCollection',
'Mixins/AsPersistedStateCollection'
], function (_, EpisodeModel, PagableCollection, AsFilteredCollection, AsPersistedStateCollection) {
var collection = PagableCollection.extend({
url : window.NzbDrone.ApiRoot + '/wanted/cutoff',
model: EpisodeModel,
tableName: 'wanted.cutoff',
state: {
pageSize : 15,
sortKey : 'airDateUtc',
order : 1
},
queryParams: {
totalPages : null,
totalRecords: null,
pageSize : 'pageSize',
sortKey : 'sortKey',
order : 'sortDir',
directions : {
'-1': 'asc',
'1' : 'desc'
}
},
// Filter Modes
filterModes: {
'monitored' : ['monitored', 'true'],
'unmonitored' : ['monitored', 'false'],
},
parseState: function (resp) {
return {totalRecords: resp.totalRecords};
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
collection = AsFilteredCollection.call(collection);
return AsPersistedStateCollection.call(collection);
});