2013-03-29 18:37:10 +00:00
|
|
|
|
"use strict";
|
2013-05-01 03:14:54 +00:00
|
|
|
|
define(['app', 'Series/EpisodeModel'], function () {
|
2013-05-01 03:04:06 +00:00
|
|
|
|
NzbDrone.Missing.Collection = Backbone.PageableCollection.extend({
|
2013-03-29 18:37:10 +00:00
|
|
|
|
url : NzbDrone.Constants.ApiRoot + '/missing',
|
2013-05-01 00:25:33 +00:00
|
|
|
|
model : NzbDrone.Series.EpisodeModel,
|
2013-05-01 07:34:05 +00:00
|
|
|
|
|
|
|
|
|
state: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
sortKey: "airDate",
|
|
|
|
|
order: 1
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
totalPages: null,
|
|
|
|
|
totalRecords: null,
|
|
|
|
|
pageSize: 'pageSize',
|
2013-05-02 05:50:34 +00:00
|
|
|
|
sortKey: "sortKey",
|
|
|
|
|
order: "sortDir",
|
2013-05-01 07:34:05 +00:00
|
|
|
|
directions: {
|
|
|
|
|
"-1": "asc",
|
|
|
|
|
"1": "desc"
|
|
|
|
|
}
|
2013-05-02 05:50:34 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
parseState: function (resp, queryParams, state) {
|
|
|
|
|
return {totalRecords: resp.totalRecords};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
parseRecords: function (resp) {
|
|
|
|
|
if (resp) {
|
|
|
|
|
return resp.records;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resp;
|
2013-03-21 03:02:57 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|