From 43446ee3d01b93c44a21a9b0b81afcc77b5e84a6 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Wed, 7 Jun 2017 13:37:20 +0200 Subject: [PATCH] Fixed: Forgot to include some js files in the last commit --- src/UI/AddMovies/AddMoviesView.js | 7 +++---- src/UI/AddMovies/DiscoverableListCollection.js | 11 +++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/UI/AddMovies/DiscoverableListCollection.js diff --git a/src/UI/AddMovies/AddMoviesView.js b/src/UI/AddMovies/AddMoviesView.js index 138271a00..50e21d291 100644 --- a/src/UI/AddMovies/AddMoviesView.js +++ b/src/UI/AddMovies/AddMoviesView.js @@ -7,7 +7,6 @@ var AddFromListCollection = require('./List/AddFromListCollection'); var SearchResultCollectionView = require('./SearchResultCollectionView'); var DiscoverableListDropdownView = require("./DiscoverableListDropdownView"); var DiscoverableListCollection = require("./DiscoverableListCollection"); -var DiscoverableListCollectionView = require("./DiscoverableListCollectionView"); var DiscoverMoviesCollection = require("./DiscoverMoviesCollection"); var EmptyView = require('./EmptyView'); var NotFoundView = require('./NotFoundView'); @@ -72,9 +71,9 @@ module.exports = Marionette.Layout.extend({ });*/ this.listenTo(DiscoverableListCollection, 'sync', this._showListDropdown); - this.listsDropdown = new DiscoverableListCollectionView({ + /*this.listsDropdown = new DiscoverableListCollectionView({ collection : DiscoverableListCollection - }) + })*/ this.throttledSearch = _.debounce(this.search, 1000, { trailing : true }).bind(this); @@ -263,7 +262,7 @@ module.exports = Marionette.Layout.extend({ this.collection = new DiscoverMoviesCollection(); this.resultCollectionView.collection = this.collection; } - + this.listenTo(this.collection, 'sync', this._showResults); this.searchResult.show(new LoadingView()); this.collection.action = action; diff --git a/src/UI/AddMovies/DiscoverableListCollection.js b/src/UI/AddMovies/DiscoverableListCollection.js new file mode 100644 index 000000000..ffa666af9 --- /dev/null +++ b/src/UI/AddMovies/DiscoverableListCollection.js @@ -0,0 +1,11 @@ +var Backbone = require('backbone'); +var NetImportModel = require('../Settings/NetImport/NetImportModel'); +var _ = require('underscore'); + +var DiscoverableCollection = Backbone.Collection.extend({ + url : window.NzbDrone.ApiRoot + '/movies/discover/lists', + model : NetImportModel, +}); +var collection = new DiscoverableCollection(); +collection.fetch(); +module.exports = collection;