episodes for series are now fetched using a single call and broken into seasons.

This commit is contained in:
kay.one 2013-06-01 12:31:39 -07:00
commit 0c63e5ad81
12 changed files with 120 additions and 48 deletions

View file

@ -0,0 +1,36 @@
"use strict";
define(['app', 'Series/Details/SeasonCollectionView','Shared/LoadingView'], function () {
NzbDrone.Series.Details.SeriesDetailsLayout = Backbone.Marionette.Layout.extend({
itemViewContainer: '.x-series-seasons',
template : 'Series/Details/SeriesDetailsTemplate',
regions: {
seasons: '#seasons'
},
onShow: function () {
var self = this;
this.seasons.show(new NzbDrone.Shared.LoadingView());
this.seasonCollection = new NzbDrone.Series.SeasonCollection();
this.episodeCollection = new NzbDrone.Series.EpisodeCollection();
$.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }}))
.done(function () {
self.seasons.show(new NzbDrone.Series.Details.SeasonCollectionView({
collection : self.seasonCollection,
episodeCollection: self.episodeCollection
}));
}
);
},
onClose: function () {
$('.backstretch').remove();
}
});
}
);