2013-06-24 23:41:59 +00:00
|
|
|
|
'use strict';
|
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'Series/EpisodeModel',
|
|
|
|
|
'backbone.pageable'
|
|
|
|
|
], function (EpisodeModel, PagableCollection) {
|
|
|
|
|
return PagableCollection.extend({
|
2013-09-14 07:10:19 +00:00
|
|
|
|
url : window.NzbDrone.ApiRoot + '/missing',
|
2013-06-24 23:41:59 +00:00
|
|
|
|
model: EpisodeModel,
|
2013-05-01 07:34:05 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
state: {
|
|
|
|
|
pageSize: 15,
|
2013-07-24 05:28:06 +00:00
|
|
|
|
sortKey : 'airDateUtc',
|
2013-06-24 23:41:59 +00:00
|
|
|
|
order : 1
|
|
|
|
|
},
|
2013-05-01 07:34:05 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
queryParams: {
|
|
|
|
|
totalPages : null,
|
|
|
|
|
totalRecords: null,
|
|
|
|
|
pageSize : 'pageSize',
|
|
|
|
|
sortKey : 'sortKey',
|
|
|
|
|
order : 'sortDir',
|
|
|
|
|
directions : {
|
|
|
|
|
'-1': 'asc',
|
|
|
|
|
'1' : 'desc'
|
|
|
|
|
}
|
|
|
|
|
},
|
2013-05-02 05:50:34 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
parseState: function (resp) {
|
|
|
|
|
return {totalRecords: resp.totalRecords};
|
|
|
|
|
},
|
2013-05-02 05:50:34 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
parseRecords: function (resp) {
|
|
|
|
|
if (resp) {
|
|
|
|
|
return resp.records;
|
|
|
|
|
}
|
2013-05-02 05:50:34 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
return resp;
|
|
|
|
|
}
|
|
|
|
|
});
|
2013-03-21 03:02:57 +00:00
|
|
|
|
});
|