1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-07-11 01:10:36 +02:00
Files
Sonarr/UI/History/Collection.js

38 lines
949 B
JavaScript
Raw Normal View History

2013-06-21 23:24:24 -07:00
'use strict';
define(['app', 'History/Model', 'backbone.pageable'], function (App, HistoryModel, PageableCollection) {
2013-06-23 19:31:02 -07:00
return PageableCollection.extend({
2013-05-02 23:53:32 -07:00
url : NzbDrone.Constants.ApiRoot + '/history',
model : NzbDrone.History.Model,
state: {
2013-05-23 17:57:34 -07:00
pageSize: 15,
2013-06-21 23:24:24 -07:00
sortKey: 'date',
2013-05-02 23:53:32 -07:00
order: 1
},
queryParams: {
totalPages: null,
totalRecords: null,
pageSize: 'pageSize',
2013-06-21 23:24:24 -07:00
sortKey: 'sortKey',
order: 'sortDir',
2013-05-02 23:53:32 -07:00
directions: {
2013-06-21 23:24:24 -07:00
'-1': 'asc',
'1': 'desc'
2013-05-02 23:53:32 -07:00
}
},
parseState: function (resp, queryParams, state) {
return {totalRecords: resp.totalRecords};
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
});