2013-06-22 08:24:24 +02:00
|
|
|
|
'use strict';
|
2013-04-24 07:56:51 +02:00
|
|
|
|
define(['app', 'Series/EpisodeModel'], function () {
|
2013-03-03 23:42:26 +01:00
|
|
|
|
NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({
|
2013-03-30 00:28:58 +01:00
|
|
|
|
url : NzbDrone.Constants.ApiRoot + '/episodes',
|
2013-06-01 21:31:39 +02:00
|
|
|
|
model: NzbDrone.Series.EpisodeModel,
|
|
|
|
|
|
|
|
|
|
bySeason: function (season) {
|
|
|
|
|
var filtered = this.filter(function (episode) {
|
2013-06-22 08:24:24 +02:00
|
|
|
|
return episode.get('seasonNumber') === season;
|
2013-06-01 21:31:39 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return new NzbDrone.Series.EpisodeCollection(filtered);
|
|
|
|
|
}
|
2013-03-03 23:42:26 +01:00
|
|
|
|
});
|
2013-06-19 03:02:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return NzbDrone.Series.EpisodeCollection;
|
2013-04-24 07:56:51 +02:00
|
|
|
|
});
|