2013-04-24 07:56:51 +02:00
|
|
|
|
"use strict";
|
|
|
|
|
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) {
|
|
|
|
|
return episode.get("seasonNumber") === season;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return new NzbDrone.Series.EpisodeCollection(filtered);
|
|
|
|
|
}
|
2013-03-03 23:42:26 +01:00
|
|
|
|
});
|
2013-04-24 07:56:51 +02:00
|
|
|
|
});
|