1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 08:22:35 +01:00
Sonarr/UI/Series/SeasonCollection.js
2013-08-05 02:09:41 -07:00

26 lines
714 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'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);
}
});
});