series collection is now loaded on app start.

pull/4/head
Keivan Beigi 11 years ago
parent f44ef2ff5e
commit 1f7d57c2c2

@ -45,18 +45,6 @@ namespace NzbDrone.Api.Series
return GetSeriesResource(series);
}
private Response GetSeriesBySlug(string slug)
{
var series = _seriesService.FindBySlug(slug);
if (series == null)
{
return new NotFoundResponse();
}
return GetSeriesResource(series).AsResponse();
}
private SeriesResource GetSeriesResource(Core.Tv.Series series)
{
if (series == null) return null;

@ -28,7 +28,6 @@ define(
},
seriesDetails: function (query) {
var series = SeriesCollection.where({titleSlug: query});
if (series.length != 0) {
@ -36,6 +35,14 @@ define(
this._setTitle(targetSeries.get('title'));
App.mainRegion.show(new SeriesDetailsLayout({ model: targetSeries }));
}
else {
this.notFound();
}
},
_showSeriesDetail: function(seriesModel){
},
addSeries: function (action) {

@ -4,8 +4,9 @@ require(
'app',
'marionette',
'Controller',
'Series/SeriesCollection',
'jQuery/RouteBinder'
], function (App, Marionette, Controller, RouterBinder) {
], function (App, Marionette, Controller, SeriesCollection, RouterBinder) {
var Router = Marionette.AppRouter.extend({
@ -32,9 +33,12 @@ require(
App.addInitializer(function () {
App.Router = new Router();
Backbone.history.start({ pushState: true });
SeriesCollection.fetch()
.done(function(){
Backbone.history.start({ pushState: true });
RouterBinder.bind(App.Router);
})
});
return App.Router;

@ -174,10 +174,6 @@ define(
},
_fetchCollection: function () {
if (SeriesCollection.length === 0) {
this.seriesRegion.show(new LoadingView());
}
SeriesCollection.fetch();
},

@ -19,7 +19,5 @@ define(
});
var collection = new Collection();
collection.fetch();
return collection;
});

Loading…
Cancel
Save