You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
'use strict';
|
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'backbone',
|
|
|
|
|
'Series/SeasonModel'
|
|
|
|
|
], function (Backbone, SeasonModel) {
|
|
|
|
|
return Backbone.Collection.extend({
|
|
|
|
|
url : window.ApiRoot + '/season',
|
|
|
|
|
model: SeasonModel,
|
|
|
|
|
|
|
|
|
|
comparator: function (season) {
|
|
|
|
|
return -season.get('seasonNumber');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
bySeries: function (series) {
|
|
|
|
|
var filtered = this.filter(function (season) {
|
|
|
|
|
return season.get('seriesId') === series;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var SeasonCollection = require('Series/SeasonCollection');
|
|
|
|
|
|
|
|
|
|
return new SeasonCollection(filtered);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|