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