From e70e76adcb4f6fc4b38c35b475d2204be8c2f4de Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 16 Feb 2018 10:53:41 +0100 Subject: [PATCH] Cleanup Series Code from UI (#2525) --- src/UI/Activity/Blacklist/BlacklistModel.js | 7 - src/UI/Activity/History/HistoryModel.js | 8 - src/UI/Activity/Queue/QueueModel.js | 5 - src/UI/AddSeries/AddSeriesCollection.js | 22 - src/UI/AddSeries/AddSeriesLayout.js | 53 -- src/UI/AddSeries/AddSeriesLayoutTemplate.hbs | 16 - src/UI/AddSeries/AddSeriesView.js | 182 ------- src/UI/AddSeries/AddSeriesViewTemplate.hbs | 24 - src/UI/AddSeries/EmptyView.js | 5 - src/UI/AddSeries/EmptyViewTemplate.hbs | 3 - src/UI/AddSeries/ErrorView.js | 13 - src/UI/AddSeries/ErrorViewTemplate.hbs | 7 - .../AddExistingSeriesCollectionView.js | 51 -- ...ddExistingSeriesCollectionViewTemplate.hbs | 5 - .../Existing/UnmappedFolderCollection.js | 20 - .../AddSeries/Existing/UnmappedFolderModel.js | 3 - .../AddSeries/MonitoringTooltipTemplate.hbs | 18 - src/UI/AddSeries/NotFoundView.js | 13 - src/UI/AddSeries/NotFoundViewTemplate.hbs | 7 - .../RootFolders/RootFolderCollection.js | 10 - .../RootFolders/RootFolderCollectionView.js | 8 - .../RootFolderCollectionViewTemplate.hbs | 13 - .../RootFolders/RootFolderItemView.js | 28 -- .../RootFolderItemViewTemplate.hbs | 9 - .../AddSeries/RootFolders/RootFolderLayout.js | 77 --- .../RootFolders/RootFolderLayoutTemplate.hbs | 36 -- .../AddSeries/RootFolders/RootFolderModel.js | 8 - .../RootFolderSelectionPartial.hbs | 11 - .../AddSeries/SearchResultCollectionView.js | 29 -- src/UI/AddSeries/SearchResultView.js | 288 ----------- src/UI/AddSeries/SearchResultViewTemplate.hbs | 111 ---- .../AddSeries/SeriesTypeSelectionPartial.hbs | 5 - .../StartingSeasonSelectionPartial.hbs | 13 - src/UI/AddSeries/addSeries.less | 173 ------- src/UI/Content/theme.less | 1 - src/UI/Controller.js | 18 - src/UI/Episode/EpisodeDetailsLayout.js | 130 ----- .../Episode/EpisodeDetailsLayoutTemplate.hbs | 35 -- .../History/EpisodeHistoryActionsCell.js | 35 -- .../History/EpisodeHistoryDetailsCell.js | 28 -- .../Episode/History/EpisodeHistoryLayout.js | 84 ---- .../History/EpisodeHistoryLayoutTemplate.hbs | 1 - src/UI/Episode/History/NoHistoryView.js | 5 - .../Episode/History/NoHistoryViewTemplate.hbs | 3 - src/UI/Episode/Search/ButtonsView.js | 5 - src/UI/Episode/Search/ButtonsViewTemplate.hbs | 4 - src/UI/Episode/Search/EpisodeSearchLayout.js | 82 --- .../Search/EpisodeSearchLayoutTemplate.hbs | 1 - src/UI/Episode/Search/ManualLayout.js | 93 ---- .../Episode/Search/ManualLayoutTemplate.hbs | 2 - src/UI/Episode/Search/NoResultsView.js | 5 - .../Episode/Search/NoResultsViewTemplate.hbs | 1 - .../Episode/Summary/EpisodeSummaryLayout.js | 119 ----- .../Summary/EpisodeSummaryLayoutTemplate.hbs | 14 - src/UI/Episode/Summary/NoFileView.js | 5 - src/UI/Episode/Summary/NoFileViewTemplate.hbs | 3 - src/UI/EpisodeFile/Editor/EmptyView.js | 5 - .../EpisodeFile/Editor/EmptyViewTemplate.hbs | 5 - .../Editor/EpisodeFileEditorLayout.js | 200 -------- .../EpisodeFileEditorLayoutTemplate.hbs | 28 -- .../EpisodeFile/Editor/QualitySelectView.js | 35 -- .../Editor/QualitySelectViewTemplate.hbs | 10 - src/UI/ManualImport/Cells/EpisodesCell.js | 46 -- src/UI/ManualImport/Cells/SeasonCell.js | 47 -- src/UI/ManualImport/Cells/SeriesCell.js | 45 -- .../Episode/SelectEpisodeLayout.js | 81 --- .../Episode/SelectEpisodeLayoutTemplate.hbs | 21 - .../ManualImport/Episode/SelectEpisodeRow.js | 20 - src/UI/ManualImport/ManualImportLayout.js | 47 -- src/UI/ManualImport/ManualImportRow.js | 1 - .../ManualImport/Season/SelectSeasonLayout.js | 28 -- .../Season/SelectSeasonLayoutTemplate.hbs | 29 -- .../ManualImport/Series/SelectSeriesLayout.js | 101 ---- .../Series/SelectSeriesLayoutTemplate.hbs | 30 -- src/UI/ManualImport/Series/SelectSeriesRow.js | 13 - .../Summary/ManualImportSummaryView.js | 14 - src/UI/Movies/Details/MoviesDetailsLayout.js | 16 +- .../Posters/SeriesPostersCollectionView.js | 2 +- src/UI/Router.js | 3 - src/UI/SeasonPass/SeasonPassFooterView.js | 139 ------ .../SeasonPassFooterViewTemplate.hbs | 36 -- src/UI/SeasonPass/SeasonPassLayout.js | 152 ------ .../SeasonPass/SeasonPassLayoutTemplate.hbs | 13 - src/UI/SeasonPass/SeasonsCell.js | 26 - src/UI/SeasonPass/SeasonsCellTemplate.hbs | 37 -- src/UI/SeasonPass/seasonpass.less | 54 -- src/UI/Series/Delete/DeleteSeriesTemplate.hbs | 50 -- src/UI/Series/Delete/DeleteSeriesView.js | 41 -- src/UI/Series/Details/EpisodeNumberCell.js | 47 -- .../Details/EpisodeNumberCellTemplate.hbs | 39 -- src/UI/Series/Details/EpisodeWarningCell.js | 21 - src/UI/Series/Details/InfoView.js | 18 - src/UI/Series/Details/InfoViewTemplate.hbs | 73 --- src/UI/Series/Details/SeasonCollectionView.js | 44 -- src/UI/Series/Details/SeasonLayout.js | 301 ----------- .../Series/Details/SeasonLayoutTemplate.hbs | 50 -- src/UI/Series/Details/SeriesDetailsLayout.js | 272 ---------- .../Series/Details/SeriesDetailsTemplate.hbs | 38 -- src/UI/Series/Edit/EditSeriesView.js | 54 -- src/UI/Series/Edit/EditSeriesViewTemplate.hbs | 104 ---- .../Editor/Organize/OrganizeFilesView.js | 33 -- .../Organize/OrganizeFilesViewTemplate.hbs | 25 - .../Series/Editor/SeriesEditorFooterView.js | 126 ----- .../Editor/SeriesEditorFooterViewTemplate.hbs | 54 -- src/UI/Series/Editor/SeriesEditorLayout.js | 184 ------- .../Editor/SeriesEditorLayoutTemplate.hbs | 7 - src/UI/Series/EpisodeCollection.js | 62 --- src/UI/Series/EpisodeFileCollection.js | 28 -- src/UI/Series/EpisodeFileModel.js | 3 - src/UI/Series/EpisodeModel.js | 20 - src/UI/Series/Index/EmptyTemplate.hbs | 16 - src/UI/Series/Index/EmptyView.js | 5 - .../Series/Index/EpisodeProgressPartial.hbs | 4 - src/UI/Series/Index/FooterModel.js | 4 - src/UI/Series/Index/FooterView.js | 5 - src/UI/Series/Index/FooterViewTemplate.hbs | 46 -- .../Overview/SeriesOverviewCollectionView.js | 8 - .../SeriesOverviewCollectionViewTemplate.hbs | 1 - .../Index/Overview/SeriesOverviewItemView.js | 7 - .../SeriesOverviewItemViewTemplate.hbs | 56 --- .../Posters/SeriesPostersCollectionView.js | 8 - .../SeriesPostersCollectionViewTemplate.hbs | 1 - .../Index/Posters/SeriesPostersItemView.js | 19 - .../Posters/SeriesPostersItemViewTemplate.hbs | 30 -- src/UI/Series/Index/SeriesIndexItemView.js | 35 -- src/UI/Series/Index/SeriesIndexLayout.js | 354 ------------- .../Index/SeriesIndexLayoutTemplate.hbs | 12 - src/UI/Series/SeasonCollection.js | 10 - src/UI/Series/SeasonModel.js | 11 - src/UI/Series/SeriesCollection.js | 120 ----- src/UI/Series/SeriesController.js | 37 -- src/UI/Series/SeriesModel.js | 31 -- src/UI/Series/series.less | 472 ------------------ src/UI/Shared/Modal/ModalController.js | 18 - src/UI/index.html | 2 - src/UI/main.js | 2 - src/UI/vent.js | 3 - 137 files changed, 9 insertions(+), 6241 deletions(-) delete mode 100644 src/UI/AddSeries/AddSeriesCollection.js delete mode 100644 src/UI/AddSeries/AddSeriesLayout.js delete mode 100644 src/UI/AddSeries/AddSeriesLayoutTemplate.hbs delete mode 100644 src/UI/AddSeries/AddSeriesView.js delete mode 100644 src/UI/AddSeries/AddSeriesViewTemplate.hbs delete mode 100644 src/UI/AddSeries/EmptyView.js delete mode 100644 src/UI/AddSeries/EmptyViewTemplate.hbs delete mode 100644 src/UI/AddSeries/ErrorView.js delete mode 100644 src/UI/AddSeries/ErrorViewTemplate.hbs delete mode 100644 src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js delete mode 100644 src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.hbs delete mode 100644 src/UI/AddSeries/Existing/UnmappedFolderCollection.js delete mode 100644 src/UI/AddSeries/Existing/UnmappedFolderModel.js delete mode 100644 src/UI/AddSeries/MonitoringTooltipTemplate.hbs delete mode 100644 src/UI/AddSeries/NotFoundView.js delete mode 100644 src/UI/AddSeries/NotFoundViewTemplate.hbs delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderCollection.js delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderCollectionView.js delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderCollectionViewTemplate.hbs delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderItemView.js delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderItemViewTemplate.hbs delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderLayout.js delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderLayoutTemplate.hbs delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderModel.js delete mode 100644 src/UI/AddSeries/RootFolders/RootFolderSelectionPartial.hbs delete mode 100644 src/UI/AddSeries/SearchResultCollectionView.js delete mode 100644 src/UI/AddSeries/SearchResultView.js delete mode 100644 src/UI/AddSeries/SearchResultViewTemplate.hbs delete mode 100644 src/UI/AddSeries/SeriesTypeSelectionPartial.hbs delete mode 100644 src/UI/AddSeries/StartingSeasonSelectionPartial.hbs delete mode 100644 src/UI/AddSeries/addSeries.less delete mode 100644 src/UI/Episode/EpisodeDetailsLayout.js delete mode 100644 src/UI/Episode/EpisodeDetailsLayoutTemplate.hbs delete mode 100644 src/UI/Episode/History/EpisodeHistoryActionsCell.js delete mode 100644 src/UI/Episode/History/EpisodeHistoryDetailsCell.js delete mode 100644 src/UI/Episode/History/EpisodeHistoryLayout.js delete mode 100644 src/UI/Episode/History/EpisodeHistoryLayoutTemplate.hbs delete mode 100644 src/UI/Episode/History/NoHistoryView.js delete mode 100644 src/UI/Episode/History/NoHistoryViewTemplate.hbs delete mode 100644 src/UI/Episode/Search/ButtonsView.js delete mode 100644 src/UI/Episode/Search/ButtonsViewTemplate.hbs delete mode 100644 src/UI/Episode/Search/EpisodeSearchLayout.js delete mode 100644 src/UI/Episode/Search/EpisodeSearchLayoutTemplate.hbs delete mode 100644 src/UI/Episode/Search/ManualLayout.js delete mode 100644 src/UI/Episode/Search/ManualLayoutTemplate.hbs delete mode 100644 src/UI/Episode/Search/NoResultsView.js delete mode 100644 src/UI/Episode/Search/NoResultsViewTemplate.hbs delete mode 100644 src/UI/Episode/Summary/EpisodeSummaryLayout.js delete mode 100644 src/UI/Episode/Summary/EpisodeSummaryLayoutTemplate.hbs delete mode 100644 src/UI/Episode/Summary/NoFileView.js delete mode 100644 src/UI/Episode/Summary/NoFileViewTemplate.hbs delete mode 100644 src/UI/EpisodeFile/Editor/EmptyView.js delete mode 100644 src/UI/EpisodeFile/Editor/EmptyViewTemplate.hbs delete mode 100644 src/UI/EpisodeFile/Editor/EpisodeFileEditorLayout.js delete mode 100644 src/UI/EpisodeFile/Editor/EpisodeFileEditorLayoutTemplate.hbs delete mode 100644 src/UI/EpisodeFile/Editor/QualitySelectView.js delete mode 100644 src/UI/EpisodeFile/Editor/QualitySelectViewTemplate.hbs delete mode 100644 src/UI/ManualImport/Cells/EpisodesCell.js delete mode 100644 src/UI/ManualImport/Cells/SeasonCell.js delete mode 100644 src/UI/ManualImport/Cells/SeriesCell.js delete mode 100644 src/UI/ManualImport/Episode/SelectEpisodeLayout.js delete mode 100644 src/UI/ManualImport/Episode/SelectEpisodeLayoutTemplate.hbs delete mode 100644 src/UI/ManualImport/Episode/SelectEpisodeRow.js delete mode 100644 src/UI/ManualImport/Season/SelectSeasonLayout.js delete mode 100644 src/UI/ManualImport/Season/SelectSeasonLayoutTemplate.hbs delete mode 100644 src/UI/ManualImport/Series/SelectSeriesLayout.js delete mode 100644 src/UI/ManualImport/Series/SelectSeriesLayoutTemplate.hbs delete mode 100644 src/UI/ManualImport/Series/SelectSeriesRow.js delete mode 100644 src/UI/SeasonPass/SeasonPassFooterView.js delete mode 100644 src/UI/SeasonPass/SeasonPassFooterViewTemplate.hbs delete mode 100644 src/UI/SeasonPass/SeasonPassLayout.js delete mode 100644 src/UI/SeasonPass/SeasonPassLayoutTemplate.hbs delete mode 100644 src/UI/SeasonPass/SeasonsCell.js delete mode 100644 src/UI/SeasonPass/SeasonsCellTemplate.hbs delete mode 100644 src/UI/SeasonPass/seasonpass.less delete mode 100644 src/UI/Series/Delete/DeleteSeriesTemplate.hbs delete mode 100644 src/UI/Series/Delete/DeleteSeriesView.js delete mode 100644 src/UI/Series/Details/EpisodeNumberCell.js delete mode 100644 src/UI/Series/Details/EpisodeNumberCellTemplate.hbs delete mode 100644 src/UI/Series/Details/EpisodeWarningCell.js delete mode 100644 src/UI/Series/Details/InfoView.js delete mode 100644 src/UI/Series/Details/InfoViewTemplate.hbs delete mode 100644 src/UI/Series/Details/SeasonCollectionView.js delete mode 100644 src/UI/Series/Details/SeasonLayout.js delete mode 100644 src/UI/Series/Details/SeasonLayoutTemplate.hbs delete mode 100644 src/UI/Series/Details/SeriesDetailsLayout.js delete mode 100644 src/UI/Series/Details/SeriesDetailsTemplate.hbs delete mode 100644 src/UI/Series/Edit/EditSeriesView.js delete mode 100644 src/UI/Series/Edit/EditSeriesViewTemplate.hbs delete mode 100644 src/UI/Series/Editor/Organize/OrganizeFilesView.js delete mode 100644 src/UI/Series/Editor/Organize/OrganizeFilesViewTemplate.hbs delete mode 100644 src/UI/Series/Editor/SeriesEditorFooterView.js delete mode 100644 src/UI/Series/Editor/SeriesEditorFooterViewTemplate.hbs delete mode 100644 src/UI/Series/Editor/SeriesEditorLayout.js delete mode 100644 src/UI/Series/Editor/SeriesEditorLayoutTemplate.hbs delete mode 100644 src/UI/Series/EpisodeCollection.js delete mode 100644 src/UI/Series/EpisodeFileCollection.js delete mode 100644 src/UI/Series/EpisodeFileModel.js delete mode 100644 src/UI/Series/EpisodeModel.js delete mode 100644 src/UI/Series/Index/EmptyTemplate.hbs delete mode 100644 src/UI/Series/Index/EmptyView.js delete mode 100644 src/UI/Series/Index/EpisodeProgressPartial.hbs delete mode 100644 src/UI/Series/Index/FooterModel.js delete mode 100644 src/UI/Series/Index/FooterView.js delete mode 100644 src/UI/Series/Index/FooterViewTemplate.hbs delete mode 100644 src/UI/Series/Index/Overview/SeriesOverviewCollectionView.js delete mode 100644 src/UI/Series/Index/Overview/SeriesOverviewCollectionViewTemplate.hbs delete mode 100644 src/UI/Series/Index/Overview/SeriesOverviewItemView.js delete mode 100644 src/UI/Series/Index/Overview/SeriesOverviewItemViewTemplate.hbs delete mode 100644 src/UI/Series/Index/Posters/SeriesPostersCollectionView.js delete mode 100644 src/UI/Series/Index/Posters/SeriesPostersCollectionViewTemplate.hbs delete mode 100644 src/UI/Series/Index/Posters/SeriesPostersItemView.js delete mode 100644 src/UI/Series/Index/Posters/SeriesPostersItemViewTemplate.hbs delete mode 100644 src/UI/Series/Index/SeriesIndexItemView.js delete mode 100644 src/UI/Series/Index/SeriesIndexLayout.js delete mode 100644 src/UI/Series/Index/SeriesIndexLayoutTemplate.hbs delete mode 100644 src/UI/Series/SeasonCollection.js delete mode 100644 src/UI/Series/SeasonModel.js delete mode 100644 src/UI/Series/SeriesCollection.js delete mode 100644 src/UI/Series/SeriesController.js delete mode 100644 src/UI/Series/SeriesModel.js delete mode 100644 src/UI/Series/series.less diff --git a/src/UI/Activity/Blacklist/BlacklistModel.js b/src/UI/Activity/Blacklist/BlacklistModel.js index c94d57d47..809186e5c 100644 --- a/src/UI/Activity/Blacklist/BlacklistModel.js +++ b/src/UI/Activity/Blacklist/BlacklistModel.js @@ -1,16 +1,9 @@ var Backbone = require('backbone'); -var SeriesModel = require('../../Series/SeriesModel'); -var EpisodeModel = require('../../Series/EpisodeModel'); var MovieModel = require('../../Movies/MovieModel'); var MoviesCollection = require('../../Movies/FullMovieCollection'); module.exports = Backbone.Model.extend({ parse : function(model) { - if (model.series) { - model.series = new SeriesModel(model.series); - model.episode = new EpisodeModel(model.episode); - model.episode.set('series', model.series); - } //if (model.movie) { // model.movie = new MovieModel(model.movie); diff --git a/src/UI/Activity/History/HistoryModel.js b/src/UI/Activity/History/HistoryModel.js index 967b7ba22..e3bc7f242 100644 --- a/src/UI/Activity/History/HistoryModel.js +++ b/src/UI/Activity/History/HistoryModel.js @@ -1,16 +1,8 @@ var Backbone = require('backbone'); -var SeriesModel = require('../../Series/SeriesModel'); -var EpisodeModel = require('../../Series/EpisodeModel'); var MovieModel = require('../../Movies/MovieModel'); module.exports = Backbone.Model.extend({ parse : function(model) { - if (model.series) { - model.series = new SeriesModel(model.series); - model.episode = new EpisodeModel(model.episode); - model.episode.set('series', model.series); - } - if (model.movie) { model.movie = new MovieModel(model.movie); } diff --git a/src/UI/Activity/Queue/QueueModel.js b/src/UI/Activity/Queue/QueueModel.js index e9b3fb045..fc8900be1 100644 --- a/src/UI/Activity/Queue/QueueModel.js +++ b/src/UI/Activity/Queue/QueueModel.js @@ -1,13 +1,8 @@ var Backbone = require('backbone'); -var SeriesModel = require('../../Series/SeriesModel'); -var EpisodeModel = require('../../Series/EpisodeModel'); var MovieModel = require('../../Movies/MovieModel'); module.exports = Backbone.Model.extend({ parse : function(model) { - model.series = new SeriesModel(model.series); - model.episode = new EpisodeModel(model.episode); - model.episode.set('series', model.series); model.movie = new MovieModel(model.movie); return model; } diff --git a/src/UI/AddSeries/AddSeriesCollection.js b/src/UI/AddSeries/AddSeriesCollection.js deleted file mode 100644 index 5be24d3a7..000000000 --- a/src/UI/AddSeries/AddSeriesCollection.js +++ /dev/null @@ -1,22 +0,0 @@ -var Backbone = require('backbone'); -var SeriesModel = require('../Series/SeriesModel'); -var _ = require('underscore'); - -module.exports = Backbone.Collection.extend({ - url : window.NzbDrone.ApiRoot + '/series/lookup', - model : SeriesModel, - - parse : function(response) { - var self = this; - - _.each(response, function(model) { - model.id = undefined; - - if (self.unmappedFolderModel) { - model.path = self.unmappedFolderModel.get('folder').path; - } - }); - - return response; - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/AddSeriesLayout.js b/src/UI/AddSeries/AddSeriesLayout.js deleted file mode 100644 index 166aedb5a..000000000 --- a/src/UI/AddSeries/AddSeriesLayout.js +++ /dev/null @@ -1,53 +0,0 @@ -var vent = require('vent'); -var AppLayout = require('../AppLayout'); -var Marionette = require('marionette'); -var RootFolderLayout = require('./RootFolders/RootFolderLayout'); -var ExistingSeriesCollectionView = require('./Existing/AddExistingSeriesCollectionView'); -var AddSeriesView = require('./AddSeriesView'); -var ProfileCollection = require('../Profile/ProfileCollection'); -var RootFolderCollection = require('./RootFolders/RootFolderCollection'); -require('../Series/SeriesCollection'); - -module.exports = Marionette.Layout.extend({ - template : 'AddSeries/AddSeriesLayoutTemplate', - - regions : { - workspace : '#add-series-workspace' - }, - - events : { - 'click .x-import' : '_importSeries', - 'click .x-add-new' : '_addSeries' - }, - - attributes : { - id : 'add-series-screen' - }, - - initialize : function() { - ProfileCollection.fetch(); - RootFolderCollection.fetch().done(function() { - RootFolderCollection.synced = true; - }); - }, - - onShow : function() { - this.workspace.show(new AddSeriesView()); - }, - - _folderSelected : function(options) { - vent.trigger(vent.Commands.CloseModalCommand); - - this.workspace.show(new ExistingSeriesCollectionView({ model : options.model })); - }, - - _importSeries : function() { - this.rootFolderLayout = new RootFolderLayout(); - this.listenTo(this.rootFolderLayout, 'folderSelected', this._folderSelected); - AppLayout.modalRegion.show(this.rootFolderLayout); - }, - - _addSeries : function() { - this.workspace.show(new AddSeriesView()); - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/AddSeriesLayoutTemplate.hbs b/src/UI/AddSeries/AddSeriesLayoutTemplate.hbs deleted file mode 100644 index 097a7ed75..000000000 --- a/src/UI/AddSeries/AddSeriesLayoutTemplate.hbs +++ /dev/null @@ -1,16 +0,0 @@ -
-
-
- - -
-
-
-
-
-
-
-
diff --git a/src/UI/AddSeries/AddSeriesView.js b/src/UI/AddSeries/AddSeriesView.js deleted file mode 100644 index 3cda1db63..000000000 --- a/src/UI/AddSeries/AddSeriesView.js +++ /dev/null @@ -1,182 +0,0 @@ -var _ = require('underscore'); -var vent = require('vent'); -var Marionette = require('marionette'); -var AddSeriesCollection = require('./AddSeriesCollection'); -var SearchResultCollectionView = require('./SearchResultCollectionView'); -var EmptyView = require('./EmptyView'); -var NotFoundView = require('./NotFoundView'); -var ErrorView = require('./ErrorView'); -var LoadingView = require('../Shared/LoadingView'); - -module.exports = Marionette.Layout.extend({ - template : 'AddSeries/AddSeriesViewTemplate', - - regions : { - searchResult : '#search-result' - }, - - ui : { - seriesSearch : '.x-series-search', - searchBar : '.x-search-bar', - loadMore : '.x-load-more' - }, - - events : { - 'click .x-load-more' : '_onLoadMore' - }, - - initialize : function(options) { - this.isExisting = options.isExisting; - this.collection = new AddSeriesCollection(); - - if (this.isExisting) { - this.collection.unmappedFolderModel = this.model; - } - - if (this.isExisting) { - this.className = 'existing-series'; - } else { - this.className = 'new-series'; - } - - this.listenTo(vent, vent.Events.SeriesAdded, this._onSeriesAdded); - this.listenTo(this.collection, 'sync', this._showResults); - - this.resultCollectionView = new SearchResultCollectionView({ - collection : this.collection, - isExisting : this.isExisting - }); - - this.throttledSearch = _.debounce(this.search, 1000, { trailing : true }).bind(this); - }, - - onRender : function() { - var self = this; - - this.$el.addClass(this.className); - - this.ui.seriesSearch.keyup(function(e) { - - if (_.contains([ - 9, - 16, - 17, - 18, - 19, - 20, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 91, - 92, - 93 - ], e.keyCode)) { - return; - } - - self._abortExistingSearch(); - self.throttledSearch({ - term : self.ui.seriesSearch.val() - }); - }); - - this._clearResults(); - - if (this.isExisting) { - this.ui.searchBar.hide(); - } - }, - - onShow : function() { - this.ui.seriesSearch.focus(); - }, - - search : function(options) { - var self = this; - - this.collection.reset(); - - if (!options.term || options.term === this.collection.term) { - return Marionette.$.Deferred().resolve(); - } - - this.searchResult.show(new LoadingView()); - this.collection.term = options.term; - this.currentSearchPromise = this.collection.fetch({ - data : { term : options.term } - }); - - this.currentSearchPromise.fail(function() { - self._showError(); - }); - - return this.currentSearchPromise; - }, - - _onSeriesAdded : function(options) { - if (this.isExisting && options.series.get('path') === this.model.get('folder').path) { - this.close(); - } - - else if (!this.isExisting) { - this.collection.term = ''; - this.collection.reset(); - this._clearResults(); - this.ui.seriesSearch.val(''); - this.ui.seriesSearch.focus(); - } - }, - - _onLoadMore : function() { - var showingAll = this.resultCollectionView.showMore(); - this.ui.searchBar.show(); - - if (showingAll) { - this.ui.loadMore.hide(); - } - }, - - _clearResults : function() { - if (!this.isExisting) { - this.searchResult.show(new EmptyView()); - } else { - this.searchResult.close(); - } - }, - - _showResults : function() { - if (!this.isClosed) { - if (this.collection.length === 0) { - this.ui.searchBar.show(); - this.searchResult.show(new NotFoundView({ term : this.collection.term })); - } else { - this.searchResult.show(this.resultCollectionView); - if (!this.showingAll && this.isExisting) { - this.ui.loadMore.show(); - } - } - } - }, - - _abortExistingSearch : function() { - if (this.currentSearchPromise && this.currentSearchPromise.readyState > 0 && this.currentSearchPromise.readyState < 4) { - console.log('aborting previous pending search request.'); - this.currentSearchPromise.abort(); - } else { - this._clearResults(); - } - }, - - _showError : function() { - if (!this.isClosed) { - this.ui.searchBar.show(); - this.searchResult.show(new ErrorView({ term : this.collection.term })); - this.collection.term = ''; - } - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/AddSeriesViewTemplate.hbs b/src/UI/AddSeries/AddSeriesViewTemplate.hbs deleted file mode 100644 index 8048f48ae..000000000 --- a/src/UI/AddSeries/AddSeriesViewTemplate.hbs +++ /dev/null @@ -1,24 +0,0 @@ -{{#if folder.path}} -
-
- {{folder.path}} -
-
{{/if}} - -
-
-
- diff --git a/src/UI/AddSeries/EmptyView.js b/src/UI/AddSeries/EmptyView.js deleted file mode 100644 index 047a07ca5..000000000 --- a/src/UI/AddSeries/EmptyView.js +++ /dev/null @@ -1,5 +0,0 @@ -var Marionette = require('marionette'); - -module.exports = Marionette.CompositeView.extend({ - template : 'AddSeries/EmptyViewTemplate' -}); \ No newline at end of file diff --git a/src/UI/AddSeries/EmptyViewTemplate.hbs b/src/UI/AddSeries/EmptyViewTemplate.hbs deleted file mode 100644 index 60346f0c0..000000000 --- a/src/UI/AddSeries/EmptyViewTemplate.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
- You can also search by tvdbid using the tvdb: prefixes. -
diff --git a/src/UI/AddSeries/ErrorView.js b/src/UI/AddSeries/ErrorView.js deleted file mode 100644 index 3b619bcb2..000000000 --- a/src/UI/AddSeries/ErrorView.js +++ /dev/null @@ -1,13 +0,0 @@ -var Marionette = require('marionette'); - -module.exports = Marionette.CompositeView.extend({ - template : 'AddSeries/ErrorViewTemplate', - - initialize : function(options) { - this.options = options; - }, - - templateHelpers : function() { - return this.options; - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/ErrorViewTemplate.hbs b/src/UI/AddSeries/ErrorViewTemplate.hbs deleted file mode 100644 index 163779c26..000000000 --- a/src/UI/AddSeries/ErrorViewTemplate.hbs +++ /dev/null @@ -1,7 +0,0 @@ -
-

- There was an error searching for '{{term}}'. -

- - If the series title contains non-alphanumeric characters try removing them, otherwise try your search again later. -
diff --git a/src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js b/src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js deleted file mode 100644 index 5c5eddc64..000000000 --- a/src/UI/AddSeries/Existing/AddExistingSeriesCollectionView.js +++ /dev/null @@ -1,51 +0,0 @@ -var Marionette = require('marionette'); -var AddSeriesView = require('../AddSeriesView'); -var UnmappedFolderCollection = require('./UnmappedFolderCollection'); - -module.exports = Marionette.CompositeView.extend({ - itemView : AddSeriesView, - itemViewContainer : '.x-loading-folders', - template : 'AddSeries/Existing/AddExistingSeriesCollectionViewTemplate', - - ui : { - loadingFolders : '.x-loading-folders' - }, - - initialize : function() { - this.collection = new UnmappedFolderCollection(); - this.collection.importItems(this.model); - }, - - showCollection : function() { - this._showAndSearch(0); - }, - - appendHtml : function(collectionView, itemView, index) { - collectionView.ui.loadingFolders.before(itemView.el); - }, - - _showAndSearch : function(index) { - var self = this; - var model = this.collection.at(index); - - if (model) { - var currentIndex = index; - var folderName = model.get('folder').name; - this.addItemView(model, this.getItemView(), index); - this.children.findByModel(model).search({ term : folderName }).always(function() { - if (!self.isClosed) { - self._showAndSearch(currentIndex + 1); - } - }); - } - - else { - this.ui.loadingFolders.hide(); - } - }, - - itemViewOptions : { - isExisting : true - } - -}); \ No newline at end of file diff --git a/src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.hbs b/src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.hbs deleted file mode 100644 index d613a52d4..000000000 --- a/src/UI/AddSeries/Existing/AddExistingSeriesCollectionViewTemplate.hbs +++ /dev/null @@ -1,5 +0,0 @@ -
-
- Loading search results from TheTVDB for your series, this may take a few minutes. -
-
\ No newline at end of file diff --git a/src/UI/AddSeries/Existing/UnmappedFolderCollection.js b/src/UI/AddSeries/Existing/UnmappedFolderCollection.js deleted file mode 100644 index bd2a83f49..000000000 --- a/src/UI/AddSeries/Existing/UnmappedFolderCollection.js +++ /dev/null @@ -1,20 +0,0 @@ -var Backbone = require('backbone'); -var UnmappedFolderModel = require('./UnmappedFolderModel'); -var _ = require('underscore'); - -module.exports = Backbone.Collection.extend({ - model : UnmappedFolderModel, - - importItems : function(rootFolderModel) { - - this.reset(); - var rootFolder = rootFolderModel; - - _.each(rootFolderModel.get('unmappedFolders'), function(folder) { - this.push(new UnmappedFolderModel({ - rootFolder : rootFolder, - folder : folder - })); - }, this); - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/Existing/UnmappedFolderModel.js b/src/UI/AddSeries/Existing/UnmappedFolderModel.js deleted file mode 100644 index 3986a5948..000000000 --- a/src/UI/AddSeries/Existing/UnmappedFolderModel.js +++ /dev/null @@ -1,3 +0,0 @@ -var Backbone = require('backbone'); - -module.exports = Backbone.Model.extend({}); \ No newline at end of file diff --git a/src/UI/AddSeries/MonitoringTooltipTemplate.hbs b/src/UI/AddSeries/MonitoringTooltipTemplate.hbs deleted file mode 100644 index 5e295c281..000000000 --- a/src/UI/AddSeries/MonitoringTooltipTemplate.hbs +++ /dev/null @@ -1,18 +0,0 @@ -
-
All
-
Monitor all episodes except specials
-
Future
-
Monitor episodes that have not aired yet
-
Missing
-
Monitor episodes that do not have files or have not aired yet
-
Existing
-
Monitor episodes that have files or have not aired yet
-
First Season
-
Monitor all episodes of the first season. All other seasons will be ignored
-
Latest Season
-
Monitor all episodes of the latest season and future seasons
-
None
-
No episodes will be monitored.
- {{!--
Latest Season
--> -
Monitor all episodes the latest season only, previous seasons will be ignored
--}} -
diff --git a/src/UI/AddSeries/NotFoundView.js b/src/UI/AddSeries/NotFoundView.js deleted file mode 100644 index 9dce2bf85..000000000 --- a/src/UI/AddSeries/NotFoundView.js +++ /dev/null @@ -1,13 +0,0 @@ -var Marionette = require('marionette'); - -module.exports = Marionette.CompositeView.extend({ - template : 'AddSeries/NotFoundViewTemplate', - - initialize : function(options) { - this.options = options; - }, - - templateHelpers : function() { - return this.options; - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/NotFoundViewTemplate.hbs b/src/UI/AddSeries/NotFoundViewTemplate.hbs deleted file mode 100644 index f203260e2..000000000 --- a/src/UI/AddSeries/NotFoundViewTemplate.hbs +++ /dev/null @@ -1,7 +0,0 @@ -
-

- Sorry. We couldn't find any series matching '{{term}}' -

- Why can't I find my show? - -
diff --git a/src/UI/AddSeries/RootFolders/RootFolderCollection.js b/src/UI/AddSeries/RootFolders/RootFolderCollection.js deleted file mode 100644 index 81050c19d..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderCollection.js +++ /dev/null @@ -1,10 +0,0 @@ -var Backbone = require('backbone'); -var RootFolderModel = require('./RootFolderModel'); -require('../../Mixins/backbone.signalr.mixin'); - -var RootFolderCollection = Backbone.Collection.extend({ - url : window.NzbDrone.ApiRoot + '/rootfolder', - model : RootFolderModel -}); - -module.exports = new RootFolderCollection(); \ No newline at end of file diff --git a/src/UI/AddSeries/RootFolders/RootFolderCollectionView.js b/src/UI/AddSeries/RootFolders/RootFolderCollectionView.js deleted file mode 100644 index f781f21d7..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderCollectionView.js +++ /dev/null @@ -1,8 +0,0 @@ -var Marionette = require('marionette'); -var RootFolderItemView = require('./RootFolderItemView'); - -module.exports = Marionette.CompositeView.extend({ - template : 'AddSeries/RootFolders/RootFolderCollectionViewTemplate', - itemViewContainer : '.x-root-folders', - itemView : RootFolderItemView -}); \ No newline at end of file diff --git a/src/UI/AddSeries/RootFolders/RootFolderCollectionViewTemplate.hbs b/src/UI/AddSeries/RootFolders/RootFolderCollectionViewTemplate.hbs deleted file mode 100644 index 70755bbca..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderCollectionViewTemplate.hbs +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - -
- Path - - Free Space -
\ No newline at end of file diff --git a/src/UI/AddSeries/RootFolders/RootFolderItemView.js b/src/UI/AddSeries/RootFolders/RootFolderItemView.js deleted file mode 100644 index a0e98100b..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderItemView.js +++ /dev/null @@ -1,28 +0,0 @@ -var Marionette = require('marionette'); - -module.exports = Marionette.ItemView.extend({ - template : 'AddSeries/RootFolders/RootFolderItemViewTemplate', - className : 'recent-folder', - tagName : 'tr', - - initialize : function() { - this.listenTo(this.model, 'change', this.render); - }, - - events : { - 'click .x-delete' : 'removeFolder', - 'click .x-folder' : 'folderSelected' - }, - - removeFolder : function() { - var self = this; - - this.model.destroy().success(function() { - self.close(); - }); - }, - - folderSelected : function() { - this.trigger('folderSelected', this.model); - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/RootFolders/RootFolderItemViewTemplate.hbs b/src/UI/AddSeries/RootFolders/RootFolderItemViewTemplate.hbs deleted file mode 100644 index 2203e1efd..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderItemViewTemplate.hbs +++ /dev/null @@ -1,9 +0,0 @@ - - {{path}} - - - {{Bytes freeSpace}} - - - - diff --git a/src/UI/AddSeries/RootFolders/RootFolderLayout.js b/src/UI/AddSeries/RootFolders/RootFolderLayout.js deleted file mode 100644 index 6dae383d7..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderLayout.js +++ /dev/null @@ -1,77 +0,0 @@ -var Marionette = require('marionette'); -var RootFolderCollectionView = require('./RootFolderCollectionView'); -var RootFolderCollection = require('./RootFolderCollection'); -var RootFolderModel = require('./RootFolderModel'); -var LoadingView = require('../../Shared/LoadingView'); -var AsValidatedView = require('../../Mixins/AsValidatedView'); -require('../../Mixins/FileBrowser'); - -var Layout = Marionette.Layout.extend({ - template : 'AddSeries/RootFolders/RootFolderLayoutTemplate', - - ui : { - pathInput : '.x-path' - }, - - regions : { - currentDirs : '#current-dirs' - }, - - events : { - 'click .x-add' : '_addFolder', - 'keydown .x-path input' : '_keydown' - }, - - initialize : function() { - this.collection = RootFolderCollection; - this.rootfolderListView = new RootFolderCollectionView({ collection : RootFolderCollection }); - - this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected); - }, - - onShow : function() { - this.listenTo(RootFolderCollection, 'sync', this._showCurrentDirs); - this.currentDirs.show(new LoadingView()); - - if (RootFolderCollection.synced) { - this._showCurrentDirs(); - } - - this.ui.pathInput.fileBrowser(); - }, - - _onFolderSelected : function(options) { - this.trigger('folderSelected', options); - }, - - _addFolder : function() { - var self = this; - - var newDir = new RootFolderModel({ - Path : this.ui.pathInput.val() - }); - - this.bindToModelValidation(newDir); - - newDir.save().done(function() { - RootFolderCollection.add(newDir); - self.trigger('folderSelected', { model : newDir }); - }); - }, - - _showCurrentDirs : function() { - this.currentDirs.show(this.rootfolderListView); - }, - - _keydown : function(e) { - if (e.keyCode !== 13) { - return; - } - - this._addFolder(); - } -}); - -var Layout = AsValidatedView.apply(Layout); - -module.exports = Layout; \ No newline at end of file diff --git a/src/UI/AddSeries/RootFolders/RootFolderLayoutTemplate.hbs b/src/UI/AddSeries/RootFolders/RootFolderLayoutTemplate.hbs deleted file mode 100644 index 83cb9535d..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderLayoutTemplate.hbs +++ /dev/null @@ -1,36 +0,0 @@ - diff --git a/src/UI/AddSeries/RootFolders/RootFolderModel.js b/src/UI/AddSeries/RootFolders/RootFolderModel.js deleted file mode 100644 index 28681768b..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderModel.js +++ /dev/null @@ -1,8 +0,0 @@ -var Backbone = require('backbone'); - -module.exports = Backbone.Model.extend({ - urlRoot : window.NzbDrone.ApiRoot + '/rootfolder', - defaults : { - freeSpace : 0 - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/RootFolders/RootFolderSelectionPartial.hbs b/src/UI/AddSeries/RootFolders/RootFolderSelectionPartial.hbs deleted file mode 100644 index 56729b0dd..000000000 --- a/src/UI/AddSeries/RootFolders/RootFolderSelectionPartial.hbs +++ /dev/null @@ -1,11 +0,0 @@ - - diff --git a/src/UI/AddSeries/SearchResultCollectionView.js b/src/UI/AddSeries/SearchResultCollectionView.js deleted file mode 100644 index e533085ac..000000000 --- a/src/UI/AddSeries/SearchResultCollectionView.js +++ /dev/null @@ -1,29 +0,0 @@ -var Marionette = require('marionette'); -var SearchResultView = require('./SearchResultView'); - -module.exports = Marionette.CollectionView.extend({ - itemView : SearchResultView, - - initialize : function(options) { - this.isExisting = options.isExisting; - this.showing = 1; - }, - - showAll : function() { - this.showingAll = true; - this.render(); - }, - - showMore : function() { - this.showing += 5; - this.render(); - - return this.showing >= this.collection.length; - }, - - appendHtml : function(collectionView, itemView, index) { - if (!this.isExisting || index < this.showing || index === 0) { - collectionView.$el.append(itemView.el); - } - } -}); \ No newline at end of file diff --git a/src/UI/AddSeries/SearchResultView.js b/src/UI/AddSeries/SearchResultView.js deleted file mode 100644 index 817ab78ea..000000000 --- a/src/UI/AddSeries/SearchResultView.js +++ /dev/null @@ -1,288 +0,0 @@ -var _ = require('underscore'); -var vent = require('vent'); -var AppLayout = require('../AppLayout'); -var Backbone = require('backbone'); -var Marionette = require('marionette'); -var Profiles = require('../Profile/ProfileCollection'); -var RootFolders = require('./RootFolders/RootFolderCollection'); -var RootFolderLayout = require('./RootFolders/RootFolderLayout'); -var SeriesCollection = require('../Series/SeriesCollection'); -var Config = require('../Config'); -var Messenger = require('../Shared/Messenger'); -var AsValidatedView = require('../Mixins/AsValidatedView'); - -require('jquery.dotdotdot'); - -var view = Marionette.ItemView.extend({ - - template : 'AddSeries/SearchResultViewTemplate', - - ui : { - profile : '.x-profile', - rootFolder : '.x-root-folder', - seasonFolder : '.x-season-folder', - seriesType : '.x-series-type', - monitor : '.x-monitor', - monitorTooltip : '.x-monitor-tooltip', - addButton : '.x-add', - addSearchButton : '.x-add-search', - overview : '.x-overview' - }, - - events : { - 'click .x-add' : '_addWithoutSearch', - 'click .x-add-search' : '_addAndSearch', - 'change .x-profile' : '_profileChanged', - 'change .x-root-folder' : '_rootFolderChanged', - 'change .x-season-folder' : '_seasonFolderChanged', - 'change .x-series-type' : '_seriesTypeChanged', - 'change .x-monitor' : '_monitorChanged' - }, - - initialize : function() { - - if (!this.model) { - throw 'model is required'; - } - - this.templateHelpers = {}; - this._configureTemplateHelpers(); - - this.listenTo(vent, Config.Events.ConfigUpdatedEvent, this._onConfigUpdated); - this.listenTo(this.model, 'change', this.render); - this.listenTo(RootFolders, 'all', this._rootFoldersUpdated); - }, - - onRender : function() { - - var defaultProfile = Config.getValue(Config.Keys.DefaultProfileId); - var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId); - var useSeasonFolder = Config.getValueBoolean(Config.Keys.UseSeasonFolder, true); - var defaultSeriesType = Config.getValue(Config.Keys.DefaultSeriesType, 'standard'); - var defaultMonitorEpisodes = Config.getValue(Config.Keys.MonitorEpisodes, 'missing'); - - if (Profiles.get(defaultProfile)) { - this.ui.profile.val(defaultProfile); - } - - if (RootFolders.get(defaultRoot)) { - this.ui.rootFolder.val(defaultRoot); - } - - this.ui.seasonFolder.prop('checked', useSeasonFolder); - this.ui.seriesType.val(defaultSeriesType); - this.ui.monitor.val(defaultMonitorEpisodes); - - //TODO: make this work via onRender, FM? - //works with onShow, but stops working after the first render - this.ui.overview.dotdotdot({ - height : 120 - }); - - this.templateFunction = Marionette.TemplateCache.get('AddSeries/MonitoringTooltipTemplate'); - var content = this.templateFunction(); - - this.ui.monitorTooltip.popover({ - content : content, - html : true, - trigger : 'hover', - title : 'Episode Monitoring Options', - placement : 'right', - container : this.$el - }); - }, - - _configureTemplateHelpers : function() { - var existingSeries = SeriesCollection.where({ tvdbId : this.model.get('tvdbId') }); - - if (existingSeries.length > 0) { - this.templateHelpers.existing = existingSeries[0].toJSON(); - } - - this.templateHelpers.profiles = Profiles.toJSON(); - - if (!this.model.get('isExisting')) { - this.templateHelpers.rootFolders = RootFolders.toJSON(); - } - }, - - _onConfigUpdated : function(options) { - if (options.key === Config.Keys.DefaultProfileId) { - this.ui.profile.val(options.value); - } - - else if (options.key === Config.Keys.DefaultRootFolderId) { - this.ui.rootFolder.val(options.value); - } - - else if (options.key === Config.Keys.UseSeasonFolder) { - this.ui.seasonFolder.prop('checked', options.value); - } - - else if (options.key === Config.Keys.DefaultSeriesType) { - this.ui.seriesType.val(options.value); - } - - else if (options.key === Config.Keys.MonitorEpisodes) { - this.ui.monitor.val(options.value); - } - }, - - _profileChanged : function() { - Config.setValue(Config.Keys.DefaultProfileId, this.ui.profile.val()); - }, - - _seasonFolderChanged : function() { - Config.setValue(Config.Keys.UseSeasonFolder, this.ui.seasonFolder.prop('checked')); - }, - - _rootFolderChanged : function() { - var rootFolderValue = this.ui.rootFolder.val(); - if (rootFolderValue === 'addNew') { - var rootFolderLayout = new RootFolderLayout(); - this.listenToOnce(rootFolderLayout, 'folderSelected', this._setRootFolder); - AppLayout.modalRegion.show(rootFolderLayout); - } else { - Config.setValue(Config.Keys.DefaultRootFolderId, rootFolderValue); - } - }, - - _seriesTypeChanged : function() { - Config.setValue(Config.Keys.DefaultSeriesType, this.ui.seriesType.val()); - }, - - _monitorChanged : function() { - Config.setValue(Config.Keys.MonitorEpisodes, this.ui.monitor.val()); - }, - - _setRootFolder : function(options) { - vent.trigger(vent.Commands.CloseModalCommand); - this.ui.rootFolder.val(options.model.id); - this._rootFolderChanged(); - }, - - _addWithoutSearch : function() { - this._addSeries(false); - }, - - _addAndSearch : function() { - this._addSeries(true); - }, - - _addSeries : function(searchForMissingEpisodes) { - var addButton = this.ui.addButton; - var addSearchButton = this.ui.addSearchButton; - - addButton.addClass('disabled'); - addSearchButton.addClass('disabled'); - - var profile = this.ui.profile.val(); - var rootFolderPath = this.ui.rootFolder.children(':selected').text(); - var seriesType = this.ui.seriesType.val(); - var seasonFolder = this.ui.seasonFolder.prop('checked'); - - var options = this._getAddSeriesOptions(); - options.searchForMissingEpisodes = searchForMissingEpisodes; - - this.model.set({ - profileId : profile, - rootFolderPath : rootFolderPath, - seasonFolder : seasonFolder, - seriesType : seriesType, - addOptions : options, - monitored : true - }, { silent : true }); - - var self = this; - var promise = this.model.save(); - - if (searchForMissingEpisodes) { - this.ui.addSearchButton.spinForPromise(promise); - } - - else { - this.ui.addButton.spinForPromise(promise); - } - - promise.always(function() { - addButton.removeClass('disabled'); - addSearchButton.removeClass('disabled'); - }); - - promise.done(function() { - SeriesCollection.add(self.model); - - self.close(); - - Messenger.show({ - message : 'Added: ' + self.model.get('title'), - actions : { - goToSeries : { - label : 'Go to Series', - action : function() { - Backbone.history.navigate('/series/' + self.model.get('titleSlug'), { trigger : true }); - } - } - }, - hideAfter : 8, - hideOnNavigate : true - }); - - vent.trigger(vent.Events.SeriesAdded, { series : self.model }); - }); - }, - - _rootFoldersUpdated : function() { - this._configureTemplateHelpers(); - this.render(); - }, - - _getAddSeriesOptions : function() { - var monitor = this.ui.monitor.val(); - var lastSeason = _.max(this.model.get('seasons'), 'seasonNumber'); - var firstSeason = _.min(_.reject(this.model.get('seasons'), { seasonNumber : 0 }), 'seasonNumber'); - - this.model.setSeasonPass(firstSeason.seasonNumber); - - var options = { - ignoreEpisodesWithFiles : false, - ignoreEpisodesWithoutFiles : false - }; - - if (monitor === 'all') { - return options; - } - - else if (monitor === 'future') { - options.ignoreEpisodesWithFiles = true; - options.ignoreEpisodesWithoutFiles = true; - } - - else if (monitor === 'latest') { - this.model.setSeasonPass(lastSeason.seasonNumber); - } - - else if (monitor === 'first') { - this.model.setSeasonPass(lastSeason.seasonNumber + 1); - this.model.setSeasonMonitored(firstSeason.seasonNumber); - } - - else if (monitor === 'missing') { - options.ignoreEpisodesWithFiles = true; - } - - else if (monitor === 'existing') { - options.ignoreEpisodesWithoutFiles = true; - } - - else if (monitor === 'none') { - this.model.setSeasonPass(lastSeason.seasonNumber + 1); - } - - return options; - } -}); - -AsValidatedView.apply(view); - -module.exports = view; diff --git a/src/UI/AddSeries/SearchResultViewTemplate.hbs b/src/UI/AddSeries/SearchResultViewTemplate.hbs deleted file mode 100644 index c6cd84799..000000000 --- a/src/UI/AddSeries/SearchResultViewTemplate.hbs +++ /dev/null @@ -1,111 +0,0 @@ -
-
- -
-
-
-

- {{titleWithYear}} - - - {{network}} - {{#unless_eq status compare="continuing"}} - Ended - {{/unless_eq}} - -

-
-
-
-
- {{overview}} -
-
-
- {{#unless existing}} - {{#unless path}} -
- - {{> RootFolderSelectionPartial rootFolders}} -
- {{/unless}} - -
- - -
- -
- - {{> ProfileSelectionPartial profiles}} -
- -
- - {{> SeriesTypeSelectionPartial}} -
- -
- - -
-
- {{/unless}} -
-
- {{#unless existing}} - {{#if title}} -
- {{!-- - Uncomment if we need to add even more controls to add series - - --}} -
- - - -
-
- {{else}} -
- -
- {{/if}} - {{else}} - - {{/unless}} -
-
-
-
diff --git a/src/UI/AddSeries/SeriesTypeSelectionPartial.hbs b/src/UI/AddSeries/SeriesTypeSelectionPartial.hbs deleted file mode 100644 index ec2990640..000000000 --- a/src/UI/AddSeries/SeriesTypeSelectionPartial.hbs +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/src/UI/AddSeries/StartingSeasonSelectionPartial.hbs b/src/UI/AddSeries/StartingSeasonSelectionPartial.hbs deleted file mode 100644 index e5623e33a..000000000 --- a/src/UI/AddSeries/StartingSeasonSelectionPartial.hbs +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/src/UI/AddSeries/addSeries.less b/src/UI/AddSeries/addSeries.less deleted file mode 100644 index 820f64af1..000000000 --- a/src/UI/AddSeries/addSeries.less +++ /dev/null @@ -1,173 +0,0 @@ -@import "../Shared/Styles/card.less"; -@import "../Shared/Styles/clickable.less"; - -#add-series-screen { - .existing-series { - - .card(); - margin : 30px 0; - - .unmapped-folder-path { - padding: 20px; - margin-left : 0; - font-weight : 100; - font-size : 25px; - text-align : center; - } - - .new-series-loadmore { - font-size : 30px; - font-weight : 300; - padding-top : 10px; - padding-bottom : 10px; - } - } - - .new-series { - .search-item { - .card(); - margin : 40px 0; - } - } - - .add-series-search { - margin-top : 20px; - margin-bottom : 20px; - } - - .search-item { - - padding-bottom : 20px; - - .series-title { - margin-top : 5px; - - .labels { - margin-left : 10px; - - .label { - font-size : 12px; - vertical-align : middle; - } - } - - .year { - font-style : italic; - color : #aaaaaa; - } - } - - .new-series-overview { - overflow : hidden; - height : 103px; - - .overview-internal { - overflow : hidden; - height : 80px; - } - } - - .series-poster { - min-width : 138px; - min-height : 203px; - max-width : 138px; - max-height : 203px; - margin : 10px; - } - - a { - color : #343434; - } - - a:hover { - text-decoration : none; - } - - select { - font-size : 14px; - } - - .checkbox { - margin-top : 0; - } - - .add { - i { - &:before { - color : #ffffff; - } - } - } - - .monitor-tooltip { - margin-left : 5px; - } - } - - .loading-folders { - margin : 30px 0; - text-align: center; - } - - .hint { - color : #999999; - font-style : italic; - } - - .monitor-tooltip-contents { - padding-bottom : 0; - - dd { - padding-bottom : 8px; - } - } -} - -li.add-new { - .clickable; - - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 20px; - color: rgb(51, 51, 51); - white-space: nowrap; -} - -li.add-new:hover { - text-decoration: none; - color: rgb(255, 255, 255); - background-color: rgb(0, 129, 194); -} - -.root-folders-modal { - overflow : visible; - - .root-folders-list { - overflow-y : auto; - max-height : 300px; - - i { - .clickable(); - } - } - - .validation-errors { - display : none; - } - - .input-group { - .form-control { - background-color : white; - } - } - - .root-folders { - margin-top : 20px; - } - - .recent-folder { - .clickable(); - } -} diff --git a/src/UI/Content/theme.less b/src/UI/Content/theme.less index 29ebf6ece..5e528f196 100644 --- a/src/UI/Content/theme.less +++ b/src/UI/Content/theme.less @@ -20,7 +20,6 @@ @import "../Shared/FileBrowser/filebrowser"; @import "badges"; @import "../ManualImport/manualimport"; -@import "../SeasonPass/seasonpass"; .main-region { @media (min-width : @screen-lg-min) { diff --git a/src/UI/Controller.js b/src/UI/Controller.js index 49d57c7be..f95a92e1b 100644 --- a/src/UI/Controller.js +++ b/src/UI/Controller.js @@ -3,22 +3,14 @@ var AppLayout = require('./AppLayout'); var Marionette = require('marionette'); var ActivityLayout = require('./Activity/ActivityLayout'); var SettingsLayout = require('./Settings/SettingsLayout'); -var AddSeriesLayout = require('./AddSeries/AddSeriesLayout'); var AddMoviesLayout = require('./AddMovies/AddMoviesLayout'); var WantedLayout = require('./Wanted/WantedLayout'); var CalendarLayout = require('./Calendar/CalendarLayout'); var ReleaseLayout = require('./Release/ReleaseLayout'); var SystemLayout = require('./System/SystemLayout'); -var SeasonPassLayout = require('./SeasonPass/SeasonPassLayout'); -var SeriesEditorLayout = require('./Series/Editor/SeriesEditorLayout'); var MovieEditorLayout = require('./Movies/Editor/MovieEditorLayout'); module.exports = NzbDroneController.extend({ - addSeries : function(action) { - this.setTitle('Add Movie'); - this.showMainRegion(new AddSeriesLayout({ action : action })); - }, - addMovies : function(action, query) { this.setTitle("Add Movie"); this.showMainRegion(new AddMoviesLayout({ action : action, query : query })); @@ -54,16 +46,6 @@ module.exports = NzbDroneController.extend({ this.showMainRegion(new SystemLayout({ action : action })); }, - seasonPass : function() { - this.setTitle('Season Pass'); - this.showMainRegion(new SeasonPassLayout()); - }, - - seriesEditor : function() { - this.setTitle('Series Editor'); - this.showMainRegion(new SeriesEditorLayout()); - }, - movieEditor : function() { this.setTitle('Movie Editor'); this.showMainRegion(new MovieEditorLayout()); diff --git a/src/UI/Episode/EpisodeDetailsLayout.js b/src/UI/Episode/EpisodeDetailsLayout.js deleted file mode 100644 index 8bdf13525..000000000 --- a/src/UI/Episode/EpisodeDetailsLayout.js +++ /dev/null @@ -1,130 +0,0 @@ -var Marionette = require('marionette'); -var SummaryLayout = require('./Summary/EpisodeSummaryLayout'); -var SearchLayout = require('./Search/EpisodeSearchLayout'); -var EpisodeHistoryLayout = require('./History/EpisodeHistoryLayout'); -var SeriesCollection = require('../Series/SeriesCollection'); -var Messenger = require('../Shared/Messenger'); - -module.exports = Marionette.Layout.extend({ - className : 'modal-lg', - template : 'Episode/EpisodeDetailsLayoutTemplate', - - regions : { - summary : '#episode-summary', - history : '#episode-history', - search : '#episode-search' - }, - - ui : { - summary : '.x-episode-summary', - history : '.x-episode-history', - search : '.x-episode-search', - monitored : '.x-episode-monitored' - }, - - events : { - - 'click .x-episode-summary' : '_showSummary', - 'click .x-episode-history' : '_showHistory', - 'click .x-episode-search' : '_showSearch', - 'click .x-episode-monitored' : '_toggleMonitored' - }, - - templateHelpers : {}, - - initialize : function(options) { - this.templateHelpers.hideSeriesLink = options.hideSeriesLink; - - this.series = SeriesCollection.get(this.model.get('seriesId')); - this.templateHelpers.series = this.series.toJSON(); - this.openingTab = options.openingTab || 'summary'; - - this.listenTo(this.model, 'sync', this._setMonitoredState); - }, - - onShow : function() { - this.searchLayout = new SearchLayout({ model : this.model }); - - if (this.openingTab === 'search') { - this.searchLayout.startManualSearch = true; - this._showSearch(); - } - - else { - this._showSummary(); - } - - this._setMonitoredState(); - - if (this.series.get('monitored')) { - this.$el.removeClass('series-not-monitored'); - } - - else { - this.$el.addClass('series-not-monitored'); - } - }, - - _showSummary : function(e) { - if (e) { - e.preventDefault(); - } - - this.ui.summary.tab('show'); - this.summary.show(new SummaryLayout({ - model : this.model, - series : this.series - })); - }, - - _showHistory : function(e) { - if (e) { - e.preventDefault(); - } - - this.ui.history.tab('show'); - this.history.show(new EpisodeHistoryLayout({ - model : this.model, - series : this.series - })); - }, - - _showSearch : function(e) { - if (e) { - e.preventDefault(); - } - - this.ui.search.tab('show'); - this.search.show(this.searchLayout); - }, - - _toggleMonitored : function() { - if (!this.series.get('monitored')) { - - Messenger.show({ - message : 'Unable to change monitored state when series is not monitored', - type : 'error' - }); - - return; - } - - var name = 'monitored'; - this.model.set(name, !this.model.get(name), { silent : true }); - - this.ui.monitored.addClass('icon-sonarr-spinner fa-spin'); - this.model.save(); - }, - - _setMonitoredState : function() { - this.ui.monitored.removeClass('fa-spin icon-sonarr-spinner'); - - if (this.model.get('monitored')) { - this.ui.monitored.addClass('icon-sonarr-monitored'); - this.ui.monitored.removeClass('icon-sonarr-unmonitored'); - } else { - this.ui.monitored.addClass('icon-sonarr-unmonitored'); - this.ui.monitored.removeClass('icon-sonarr-monitored'); - } - } -}); diff --git a/src/UI/Episode/EpisodeDetailsLayoutTemplate.hbs b/src/UI/Episode/EpisodeDetailsLayoutTemplate.hbs deleted file mode 100644 index bac2e4559..000000000 --- a/src/UI/Episode/EpisodeDetailsLayoutTemplate.hbs +++ /dev/null @@ -1,35 +0,0 @@ -