1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-21 01:49:57 +02:00
Sonarr/UI/Series/SeasonCollection.js

26 lines
714 B
JavaScript
Raw Normal View History

'use strict';
define(
[
'backbone',
'Series/SeasonModel'
], function (Backbone, SeasonModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/season',
model: SeasonModel,
2013-05-12 18:53:39 +03:00
comparator: function (season) {
return -season.get('seasonNumber');
},
2013-05-12 18:53:39 +03:00
bySeries: function (series) {
var filtered = this.filter(function (season) {
return season.get('seriesId') === series;
});
var SeasonCollection = require('Series/SeasonCollection');
return new SeasonCollection(filtered);
}
});
2013-03-04 01:42:26 +03:00
});