From 1f94e2b55f37ed6d207531f9306fbd6e73b2e626 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 14 Feb 2013 22:57:01 -0800 Subject: [PATCH] fixed add series. --- .../AddSeries/Existing/ImportSeriesView.js | 17 +++-------------- .../AddSeries/New/SearchResultView.js | 5 ++++- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/NzbDrone.Web/_backboneApp/AddSeries/Existing/ImportSeriesView.js b/NzbDrone.Web/_backboneApp/AddSeries/Existing/ImportSeriesView.js index 891f8d0c1..88b4632c6 100644 --- a/NzbDrone.Web/_backboneApp/AddSeries/Existing/ImportSeriesView.js +++ b/NzbDrone.Web/_backboneApp/AddSeries/Existing/ImportSeriesView.js @@ -13,6 +13,8 @@ define([ addSeries:function () { + var self = this; + var seriesId = this.model.get('id'); var title = this.model.get('seriesName'); var quality = this.options.qualityProfile.val(); @@ -25,23 +27,10 @@ define([ path:path }); - var self = this; var seriesCollection = new NzbDrone.Series.SeriesCollection(); + seriesCollection.add(model); - seriesCollection.add(model, {success:function () { - var notificationModel = new NzbDrone.Shared.NotificationModel({ - title:'Added', - message:title, - level:'success' - }); - - notificationCollection.push(notificationModel); - self.close(); - } - }); - - return; model.save(undefined, { success:function () { var notificationModel = new NzbDrone.Shared.NotificationModel({ diff --git a/NzbDrone.Web/_backboneApp/AddSeries/New/SearchResultView.js b/NzbDrone.Web/_backboneApp/AddSeries/New/SearchResultView.js index 5e5187688..416d079b7 100644 --- a/NzbDrone.Web/_backboneApp/AddSeries/New/SearchResultView.js +++ b/NzbDrone.Web/_backboneApp/AddSeries/New/SearchResultView.js @@ -1,6 +1,6 @@ 'use strict'; -define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection', 'AddSeries/SearchResultModel', 'Series/SeriesModel'], function (app,notificationCollection) { +define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection', 'AddSeries/SearchResultModel', 'Series/SeriesCollection'], function (app,notificationCollection) { NzbDrone.AddSeries.New.SearchItemView = Backbone.Marionette.ItemView.extend({ @@ -41,6 +41,9 @@ define(['app','Shared/NotificationCollection', 'AddSeries/SearchResultCollection var self = this; + var seriesCollection = new NzbDrone.Series.SeriesCollection(); + seriesCollection.push(model); + model.save(undefined, { success: function () { var notificationModel = new NzbDrone.Shared.NotificationModel({