mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-21 01:49:57 +02:00
6ca17942f0
Linked from missing
26 lines
714 B
JavaScript
26 lines
714 B
JavaScript
'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);
|
|
}
|
|
});
|
|
});
|