lidarr/UI/History/HistoryCollection.js
Mark McDowall daeb2fc652 Episode grid will show downloading on grab
New: Update episode status in UI on grab and download
2013-10-01 22:20:30 -07:00

41 lines
1 KiB
JavaScript

'use strict';
define(
[
'History/HistoryModel',
'backbone.pageable'
], function (HistoryModel, PageableCollection) {
return PageableCollection.extend({
url : window.NzbDrone.ApiRoot + '/history',
model: HistoryModel,
state: {
pageSize: 15,
sortKey : 'date',
order : 1
},
queryParams: {
totalPages : null,
totalRecords: null,
pageSize : 'pageSize',
sortKey : 'sortKey',
order : 'sortDir',
directions : {
'-1': 'asc',
'1' : 'desc'
}
},
parseState: function (resp) {
return {totalRecords: resp.totalRecords};
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
});