2013-04-24 05:56:51 +00:00
|
|
|
|
"use strict";
|
|
|
|
|
define(['app', 'Series/EpisodeModel'], function () {
|
2013-03-03 22:42:26 +00:00
|
|
|
|
NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({
|
2013-03-29 23:28:58 +00:00
|
|
|
|
url : NzbDrone.Constants.ApiRoot + '/episodes',
|
2013-06-01 19:31:39 +00: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 22:42:26 +00:00
|
|
|
|
});
|
2013-06-19 01:02:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return NzbDrone.Series.EpisodeCollection;
|
2013-04-24 05:56:51 +00:00
|
|
|
|
});
|