diff --git a/src/UI/.idea/.name b/src/UI/.idea/.name deleted file mode 100644 index 78ec2c0fe..000000000 --- a/src/UI/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -NzbDrone.UI \ No newline at end of file diff --git a/src/UI/.idea/NzbDrone.UI.iml b/src/UI/.idea/NzbDrone.UI.iml deleted file mode 100644 index 2184ad470..000000000 --- a/src/UI/.idea/NzbDrone.UI.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/UI/.idea/codeStyleSettings.xml b/src/UI/.idea/codeStyleSettings.xml deleted file mode 100644 index 7598f4c8e..000000000 --- a/src/UI/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/UI/.idea/dictionaries/Keivan.xml b/src/UI/.idea/dictionaries/Keivan.xml deleted file mode 100644 index e85a39c0f..000000000 --- a/src/UI/.idea/dictionaries/Keivan.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - deps - mixins - nzbdrone - rootdir - rootfolder - rootfolders - signalr - sonarr - templated - thetvdb - trakt - tvdb - xlarge - yyyy - - - \ No newline at end of file diff --git a/src/UI/.idea/dictionaries/Keivan_Beigi.xml b/src/UI/.idea/dictionaries/Keivan_Beigi.xml deleted file mode 100644 index 00d8e4cec..000000000 --- a/src/UI/.idea/dictionaries/Keivan_Beigi.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - backgrid - bnzbd - clickable - couldn - mouseenter - mouseleave - navbar - - - \ No newline at end of file diff --git a/src/UI/.idea/dictionaries/Mark.xml b/src/UI/.idea/dictionaries/Mark.xml deleted file mode 100644 index ecbbe884c..000000000 --- a/src/UI/.idea/dictionaries/Mark.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/UI/.idea/encodings.xml b/src/UI/.idea/encodings.xml deleted file mode 100644 index e55d06786..000000000 --- a/src/UI/.idea/encodings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/UI/.idea/inspectionProfiles/Project_Default.xml b/src/UI/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 7aba4e3c2..000000000 --- a/src/UI/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/UI/.idea/inspectionProfiles/profiles_settings.xml b/src/UI/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b312839b..000000000 --- a/src/UI/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/UI/.idea/jsLibraryMappings.xml b/src/UI/.idea/jsLibraryMappings.xml deleted file mode 100644 index 62c621f94..000000000 --- a/src/UI/.idea/jsLibraryMappings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/UI/.idea/jsLinters/jshint.xml b/src/UI/.idea/jsLinters/jshint.xml deleted file mode 100644 index 0b5c0e41e..000000000 --- a/src/UI/.idea/jsLinters/jshint.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/UI/.idea/jsLinters/jslint.xml b/src/UI/.idea/jsLinters/jslint.xml deleted file mode 100644 index 822a7aa5e..000000000 --- a/src/UI/.idea/jsLinters/jslint.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/src/UI/.idea/misc.xml b/src/UI/.idea/misc.xml deleted file mode 100644 index e9e9ba1c3..000000000 --- a/src/UI/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/UI/.idea/modules.xml b/src/UI/.idea/modules.xml deleted file mode 100644 index ab774833e..000000000 --- a/src/UI/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/UI/.idea/runConfigurations/Debug___Chrome.xml b/src/UI/.idea/runConfigurations/Debug___Chrome.xml deleted file mode 100644 index d26613fb6..000000000 --- a/src/UI/.idea/runConfigurations/Debug___Chrome.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/UI/.idea/scopes/NzbDrone.xml b/src/UI/.idea/scopes/NzbDrone.xml deleted file mode 100644 index 17c1c9c5e..000000000 --- a/src/UI/.idea/scopes/NzbDrone.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/UI/.idea/scopes/scope_settings.xml b/src/UI/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b84..000000000 --- a/src/UI/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/UI/.idea/vcs.xml b/src/UI/.idea/vcs.xml deleted file mode 100644 index 9ab281ac8..000000000 --- a/src/UI/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/UI/.jshintrc b/src/UI/.jshintrc deleted file mode 100644 index 46ccc54aa..000000000 --- a/src/UI/.jshintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "-W030": false, - "-W064": false, - "-W097": false, - "-W100": false, - "undef": true, - "curly": true, - "immed": true, - "eqeqeq": true, - "latedef": true, - "globals": { - "module": true, - "require": true, - "define": true, - "window": true, - "document": true, - "console": true, - "_": true - } -} diff --git a/src/UI/Activity/ActivityLayout.js b/src/UI/Activity/ActivityLayout.js deleted file mode 100644 index a8826a714..000000000 --- a/src/UI/Activity/ActivityLayout.js +++ /dev/null @@ -1,84 +0,0 @@ -var Marionette = require('marionette'); -var Backbone = require('backbone'); -var Backgrid = require('backgrid'); -var HistoryLayout = require('./History/HistoryLayout'); -var BlacklistLayout = require('./Blacklist/BlacklistLayout'); -var QueueLayout = require('./Queue/QueueLayout'); - -module.exports = Marionette.Layout.extend({ - template : 'Activity/ActivityLayoutTemplate', - - regions : { - queueRegion : '#queue', - history : '#history', - blacklist : '#blacklist' - }, - - ui : { - queueTab : '.x-queue-tab', - historyTab : '.x-history-tab', - blacklistTab : '.x-blacklist-tab' - }, - - events : { - 'click .x-queue-tab' : '_showQueue', - 'click .x-history-tab' : '_showHistory', - 'click .x-blacklist-tab' : '_showBlacklist' - }, - - initialize : function(options) { - if (options.action) { - this.action = options.action.toLowerCase(); - } - }, - - onShow : function() { - switch (this.action) { - case 'history': - this._showHistory(); - break; - case 'blacklist': - this._showBlacklist(); - break; - default: - this._showQueue(); - } - }, - - _navigate : function(route) { - Backbone.history.navigate(route, { - trigger : false, - replace : true - }); - }, - - _showHistory : function(e) { - if (e) { - e.preventDefault(); - } - - this.history.show(new HistoryLayout()); - this.ui.historyTab.tab('show'); - this._navigate('/activity/history'); - }, - - _showBlacklist : function(e) { - if (e) { - e.preventDefault(); - } - - this.blacklist.show(new BlacklistLayout()); - this.ui.blacklistTab.tab('show'); - this._navigate('/activity/blacklist'); - }, - - _showQueue : function(e) { - if (e) { - e.preventDefault(); - } - - this.queueRegion.show(new QueueLayout()); - this.ui.queueTab.tab('show'); - this._navigate('/activity/queue'); - } -}); \ No newline at end of file diff --git a/src/UI/Activity/ActivityLayoutTemplate.hbs b/src/UI/Activity/ActivityLayoutTemplate.hbs deleted file mode 100644 index c9c08ecf7..000000000 --- a/src/UI/Activity/ActivityLayoutTemplate.hbs +++ /dev/null @@ -1,11 +0,0 @@ - - -
-
-
-
-
\ No newline at end of file diff --git a/src/UI/Activity/Blacklist/BlacklistActionsCell.js b/src/UI/Activity/Blacklist/BlacklistActionsCell.js deleted file mode 100644 index a3fb2e55b..000000000 --- a/src/UI/Activity/Blacklist/BlacklistActionsCell.js +++ /dev/null @@ -1,28 +0,0 @@ -var vent = require('vent'); -var NzbDroneCell = require('../../Cells/NzbDroneCell'); -var BlacklistDetailsLayout = require('./Details/BlacklistDetailsLayout'); - -module.exports = NzbDroneCell.extend({ - className : 'blacklist-actions-cell', - - events : { - 'click .x-details' : '_details', - 'click .x-delete' : '_delete' - }, - - render : function() { - this.$el.empty(); - this.$el.html('' + - ''); - - return this; - }, - - _details : function() { - vent.trigger(vent.Commands.OpenModalCommand, new BlacklistDetailsLayout({ model : this.model })); - }, - - _delete : function() { - this.model.destroy(); - } -}); diff --git a/src/UI/Activity/Blacklist/BlacklistCollection.js b/src/UI/Activity/Blacklist/BlacklistCollection.js deleted file mode 100644 index 626123711..000000000 --- a/src/UI/Activity/Blacklist/BlacklistCollection.js +++ /dev/null @@ -1,47 +0,0 @@ -var BlacklistModel = require('./BlacklistModel'); -var PageableCollection = require('backbone.pageable'); -var AsSortedCollection = require('../../Mixins/AsSortedCollection'); -var AsPersistedStateCollection = require('../../Mixins/AsPersistedStateCollection'); - -var Collection = PageableCollection.extend({ - url : window.NzbDrone.ApiRoot + '/blacklist', - model : BlacklistModel, - - state : { - pageSize : 15, - sortKey : 'date', - order : 1 - }, - - queryParams : { - totalPages : null, - totalRecords : null, - pageSize : 'pageSize', - sortKey : 'sortKey', - order : 'sortDir', - directions : { - '-1' : 'asc', - '1' : 'desc' - } - }, - - sortMappings : { - 'movie' : { sortKey : 'movie.title' } - }, - - parseState : function(resp) { - return { totalRecords : resp.totalRecords }; - }, - - parseRecords : function(resp) { - if (resp) { - return resp.records; - } - - return resp; - } -}); -Collection = AsSortedCollection.call(Collection); -Collection = AsPersistedStateCollection.call(Collection); - -module.exports = Collection; \ No newline at end of file diff --git a/src/UI/Activity/Blacklist/BlacklistLayout.js b/src/UI/Activity/Blacklist/BlacklistLayout.js deleted file mode 100644 index 42eac5a1a..000000000 --- a/src/UI/Activity/Blacklist/BlacklistLayout.js +++ /dev/null @@ -1,115 +0,0 @@ -var vent = require('vent'); -var Marionette = require('marionette'); -var Backgrid = require('backgrid'); -var BlacklistCollection = require('./BlacklistCollection'); -var MovieTitleCell = require('../../Cells/MovieTitleCell'); -var QualityCell = require('../../Cells/QualityCell'); -var RelativeDateCell = require('../../Cells/RelativeDateCell'); -var BlacklistActionsCell = require('./BlacklistActionsCell'); -var GridPager = require('../../Shared/Grid/Pager'); -var LoadingView = require('../../Shared/LoadingView'); -var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout'); - -module.exports = Marionette.Layout.extend({ - template : 'Activity/Blacklist/BlacklistLayoutTemplate', - - regions : { - blacklist : '#x-blacklist', - toolbar : '#x-toolbar', - pager : '#x-pager' - }, - - columns : [ - { - name : 'movie', - label : 'Movie Title', - cell : MovieTitleCell - }, - { - name : 'sourceTitle', - label : 'Source Title', - cell : 'string' - }, - { - name : 'quality', - label : 'Quality', - cell : QualityCell, - sortable : false - }, - { - name : 'date', - label : 'Date', - cell : RelativeDateCell - }, - { - name : 'this', - label : '', - cell : BlacklistActionsCell, - sortable : false - } - ], - - initialize : function() { - this.collection = new BlacklistCollection({ tableName : 'blacklist' }); - - this.listenTo(this.collection, 'sync', this._showTable); - this.listenTo(vent, vent.Events.CommandComplete, this._commandComplete); - }, - - onShow : function() { - this.blacklist.show(new LoadingView()); - this._showToolbar(); - this.collection.fetch(); - }, - - _showTable : function(collection) { - - this.blacklist.show(new Backgrid.Grid({ - columns : this.columns, - collection : collection, - className : 'table table-hover' - })); - - this.pager.show(new GridPager({ - columns : this.columns, - collection : collection - })); - }, - - _showToolbar : function() { - var leftSideButtons = { - type : 'default', - storeState : false, - collapse: true, - items : [ - { - title : 'Clear Blacklist', - icon : 'icon-radarr-clear', - command : 'clearBlacklist' - } - ] - }; - - this.toolbar.show(new ToolbarLayout({ - left : [ - leftSideButtons - ], - context : this - })); - }, - - _refreshTable : function(buttonContext) { - this.collection.state.currentPage = 1; - var promise = this.collection.fetch({ reset : true }); - - if (buttonContext) { - buttonContext.ui.icon.spinForPromise(promise); - } - }, - - _commandComplete : function(options) { - if (options.command.get('name') === 'clearblacklist') { - this._refreshTable(); - } - } -}); diff --git a/src/UI/Activity/Blacklist/BlacklistLayoutTemplate.hbs b/src/UI/Activity/Blacklist/BlacklistLayoutTemplate.hbs deleted file mode 100644 index 8f78eb0db..000000000 --- a/src/UI/Activity/Blacklist/BlacklistLayoutTemplate.hbs +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/Activity/Blacklist/BlacklistModel.js b/src/UI/Activity/Blacklist/BlacklistModel.js deleted file mode 100644 index 809186e5c..000000000 --- a/src/UI/Activity/Blacklist/BlacklistModel.js +++ /dev/null @@ -1,16 +0,0 @@ -var Backbone = require('backbone'); -var MovieModel = require('../../Movies/MovieModel'); -var MoviesCollection = require('../../Movies/FullMovieCollection'); - -module.exports = Backbone.Model.extend({ - parse : function(model) { - - //if (model.movie) { - // model.movie = new MovieModel(model.movie); - //} - - model.movie = MoviesCollection.get(model.movieId); - - return model; - } -}); diff --git a/src/UI/Activity/Blacklist/Details/BlacklistDetailsLayout.js b/src/UI/Activity/Blacklist/Details/BlacklistDetailsLayout.js deleted file mode 100644 index cdcbf25f0..000000000 --- a/src/UI/Activity/Blacklist/Details/BlacklistDetailsLayout.js +++ /dev/null @@ -1,14 +0,0 @@ -var Marionette = require('marionette'); -var BlacklistDetailsView = require('./BlacklistDetailsView'); - -module.exports = Marionette.Layout.extend({ - template : 'Activity/Blacklist/Details/BlacklistDetailsLayoutTemplate', - - regions : { - bodyRegion : '.modal-body' - }, - - onShow : function() { - this.bodyRegion.show(new BlacklistDetailsView({ model : this.model })); - } -}); \ No newline at end of file diff --git a/src/UI/Activity/Blacklist/Details/BlacklistDetailsLayoutTemplate.hbs b/src/UI/Activity/Blacklist/Details/BlacklistDetailsLayoutTemplate.hbs deleted file mode 100644 index 3cdfa99c7..000000000 --- a/src/UI/Activity/Blacklist/Details/BlacklistDetailsLayoutTemplate.hbs +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/src/UI/Activity/Blacklist/Details/BlacklistDetailsView.js b/src/UI/Activity/Blacklist/Details/BlacklistDetailsView.js deleted file mode 100644 index 1b7bc883d..000000000 --- a/src/UI/Activity/Blacklist/Details/BlacklistDetailsView.js +++ /dev/null @@ -1,5 +0,0 @@ -var Marionette = require('marionette'); - -module.exports = Marionette.ItemView.extend({ - template : 'Activity/Blacklist/Details/BlacklistDetailsViewTemplate' -}); \ No newline at end of file diff --git a/src/UI/Activity/Blacklist/Details/BlacklistDetailsViewTemplate.hbs b/src/UI/Activity/Blacklist/Details/BlacklistDetailsViewTemplate.hbs deleted file mode 100644 index d29a878fc..000000000 --- a/src/UI/Activity/Blacklist/Details/BlacklistDetailsViewTemplate.hbs +++ /dev/null @@ -1,23 +0,0 @@ -
- -
Name:
-
{{sourceTitle}}
- - {{#if protocol}} - {{#unless_eq protocol compare="unknown"}} -
Protocol:
-
{{protocol}}
- {{/unless_eq}} - {{/if}} - - {{#if indexer}} -
Indexer:
-
{{indexer}}
- {{/if}} - - - {{#if message}} -
Message:
-
{{message}}
- {{/if}} -
diff --git a/src/UI/Activity/History/Details/HistoryDetailsAge.js b/src/UI/Activity/History/Details/HistoryDetailsAge.js deleted file mode 100644 index a7c40f69a..000000000 --- a/src/UI/Activity/History/Details/HistoryDetailsAge.js +++ /dev/null @@ -1,22 +0,0 @@ -var Handlebars = require('handlebars'); -var FormatHelpers = require('../../../Shared/FormatHelpers'); - -Handlebars.registerHelper('historyAge', function() { - - var age = this.age; - var unit = FormatHelpers.plural(Math.round(age), 'day'); - var ageHours = parseFloat(this.ageHours); - var ageMinutes = this.ageMinutes ? parseFloat(this.ageMinutes) : null; - - if (age < 2) { - age = ageHours.toFixed(1); - unit = FormatHelpers.plural(Math.round(ageHours), 'hour'); - } - - if (age < 2 && ageMinutes) { - age = parseFloat(ageMinutes).toFixed(1); - unit = FormatHelpers.plural(Math.round(ageMinutes), 'minute'); - } - - return new Handlebars.SafeString('
Age (when grabbed):
{0} {1}
'.format(age, unit)); -}); diff --git a/src/UI/Activity/History/Details/HistoryDetailsLayout.js b/src/UI/Activity/History/Details/HistoryDetailsLayout.js deleted file mode 100644 index 42f583ddb..000000000 --- a/src/UI/Activity/History/Details/HistoryDetailsLayout.js +++ /dev/null @@ -1,35 +0,0 @@ -var $ = require('jquery'); -var vent = require('vent'); -var Marionette = require('marionette'); -var HistoryDetailsView = require('./HistoryDetailsView'); - -module.exports = Marionette.Layout.extend({ - template : 'Activity/History/Details/HistoryDetailsLayoutTemplate', - - regions : { - bodyRegion : '.modal-body' - }, - - events : { - 'click .x-mark-as-failed' : '_markAsFailed' - }, - - onShow : function() { - this.bodyRegion.show(new HistoryDetailsView({ model : this.model })); - }, - - _markAsFailed : function() { - var url = window.NzbDrone.ApiRoot + '/history/failed'; - var data = { - id : this.model.get('id') - }; - - $.ajax({ - url : url, - type : 'POST', - data : data - }); - - vent.trigger(vent.Commands.CloseModalCommand); - } -}); diff --git a/src/UI/Activity/History/Details/HistoryDetailsLayoutTemplate.hbs b/src/UI/Activity/History/Details/HistoryDetailsLayoutTemplate.hbs deleted file mode 100644 index 1907626fc..000000000 --- a/src/UI/Activity/History/Details/HistoryDetailsLayoutTemplate.hbs +++ /dev/null @@ -1,22 +0,0 @@ - diff --git a/src/UI/Activity/History/Details/HistoryDetailsView.js b/src/UI/Activity/History/Details/HistoryDetailsView.js deleted file mode 100644 index a883b0cb4..000000000 --- a/src/UI/Activity/History/Details/HistoryDetailsView.js +++ /dev/null @@ -1,6 +0,0 @@ -var Marionette = require('marionette'); -require('./HistoryDetailsAge'); - -module.exports = Marionette.ItemView.extend({ - template : 'Activity/History/Details/HistoryDetailsViewTemplate' -}); \ No newline at end of file diff --git a/src/UI/Activity/History/Details/HistoryDetailsViewTemplate.hbs b/src/UI/Activity/History/Details/HistoryDetailsViewTemplate.hbs deleted file mode 100644 index 83c86e4e3..000000000 --- a/src/UI/Activity/History/Details/HistoryDetailsViewTemplate.hbs +++ /dev/null @@ -1,103 +0,0 @@ -{{#if_eq eventType compare="grabbed"}} -
- -
Name:
-
{{sourceTitle}}
- - {{#with data}} - {{#if indexer}} -
Indexer:
-
{{indexer}}
- {{/if}} - - {{#if releaseGroup}} -
Release Group:
-
{{releaseGroup}}
- {{/if}} - - {{#if nzbInfoUrl}} -
Info:
-
{{nzbInfoUrl}}
- {{/if}} - - {{#if downloadClient}} -
Download Client:
-
{{downloadClient}}
- {{/if}} - - {{#if downloadId}} -
Grab ID:
-
{{downloadId}}
- {{/if}} - - {{#if age}} - {{historyAge}} - {{/if}} - - {{#if publishedDate}} -
Published Date:
-
{{ShortDate publishedDate}} {{LTS publishedDate}}
- {{/if}} - {{/with}} -
-{{/if_eq}} - -{{#if_eq eventType compare="downloadFailed"}} -
- -
Name:
-
{{sourceTitle}}
- - {{#with data}} -
Message:
-
{{message}}
- {{/with}} -
-{{/if_eq}} - -{{#if_eq eventType compare="downloadFolderImported"}} -
- - {{#if sourceTitle}} -
Name:
-
{{sourceTitle}}
- {{/if}} - - {{#with data}} - {{#if droppedPath}} -
Source:
-
{{droppedPath}}
- {{/if}} - - {{#if importedPath}} -
Imported To:
-
{{importedPath}}
- {{/if}} - {{/with}} -
-{{/if_eq}} - -{{#if_eq eventType compare="movieFileDeleted"}} -
- -
Path:
-
{{sourceTitle}}
- - {{#with data}} -
Reason:
-
- {{#if_eq reason compare="Manual"}} - File was deleted by via UI - {{/if_eq}} - - {{#if_eq reason compare="MissingFromDisk"}} - Radarr was unable to find the file on disk so it was removed - {{/if_eq}} - - {{#if_eq reason compare="Upgrade"}} - File was deleted to import an upgrade - {{/if_eq}} -
- {{/with}} -
-{{/if_eq}} \ No newline at end of file diff --git a/src/UI/Activity/History/HistoryCollection.js b/src/UI/Activity/History/HistoryCollection.js deleted file mode 100644 index 3db1b0d21..000000000 --- a/src/UI/Activity/History/HistoryCollection.js +++ /dev/null @@ -1,87 +0,0 @@ -var HistoryModel = require('./HistoryModel'); -var PageableCollection = require('backbone.pageable'); -var AsFilteredCollection = require('../../Mixins/AsFilteredCollection'); -var AsSortedCollection = require('../../Mixins/AsSortedCollection'); -var AsPersistedStateCollection = require('../../Mixins/AsPersistedStateCollection'); - -var Collection = PageableCollection.extend({ - url : window.NzbDrone.ApiRoot + '/history', - model : HistoryModel, - - state : { - pageSize : 15, - sortKey : 'date', - order : 1 - }, - - queryParams : { - totalPages : null, - totalRecords : null, - pageSize : 'pageSize', - sortKey : 'sortKey', - order : 'sortDir', - directions : { - '-1' : 'asc', - '1' : 'desc' - } - }, - - filterModes : { - 'all' : [ - null, - null - ], - 'grabbed' : [ - 'eventType', - '1' - ], - 'imported' : [ - 'eventType', - '3' - ], - 'failed' : [ - 'eventType', - '4' - ], - 'deleted' : [ - 'eventType', - '6' - ] - }, - - sortMappings : { - 'movie' : { sortKey : 'movie.title' } - }, - - initialize : function(options) { - delete this.queryParams.episodeId; - delete this.queryParams.movieId; - - if (options) { - if (options.episodeId) { - this.queryParams.episodeId = options.episodeId; - } - if (options.movieId) { - this.queryParams.movieId = options.movieId; - } - } - }, - - parseState : function(resp) { - return { totalRecords : resp.totalRecords }; - }, - - parseRecords : function(resp) { - if (resp) { - return resp.records; - } - - return resp; - } -}); - -Collection = AsFilteredCollection.call(Collection); -Collection = AsSortedCollection.call(Collection); -Collection = AsPersistedStateCollection.call(Collection); - -module.exports = Collection; diff --git a/src/UI/Activity/History/HistoryDetailsCell.js b/src/UI/Activity/History/HistoryDetailsCell.js deleted file mode 100644 index 3389046a0..000000000 --- a/src/UI/Activity/History/HistoryDetailsCell.js +++ /dev/null @@ -1,21 +0,0 @@ -var vent = require('vent'); -var NzbDroneCell = require('../../Cells/NzbDroneCell'); - -module.exports = NzbDroneCell.extend({ - className : 'history-details-cell', - - events : { - 'click' : '_showDetails' - }, - - render : function() { - this.$el.empty(); - this.$el.html(''); - - return this; - }, - - _showDetails : function() { - vent.trigger(vent.Commands.ShowHistoryDetails, { model : this.model }); - } -}); \ No newline at end of file diff --git a/src/UI/Activity/History/HistoryLayout.js b/src/UI/Activity/History/HistoryLayout.js deleted file mode 100644 index 4e5cb8a68..000000000 --- a/src/UI/Activity/History/HistoryLayout.js +++ /dev/null @@ -1,140 +0,0 @@ -var Marionette = require('marionette'); -var Backgrid = require('backgrid'); -var HistoryCollection = require('./HistoryCollection'); -var EventTypeCell = require('../../Cells/EventTypeCell'); -var MovieTitleCell = require('../../Cells/MovieTitleCell'); -var HistoryQualityCell = require('./HistoryQualityCell'); -var RelativeDateCell = require('../../Cells/RelativeDateCell'); -var HistoryDetailsCell = require('./HistoryDetailsCell'); -var GridPager = require('../../Shared/Grid/Pager'); -var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout'); -var LoadingView = require('../../Shared/LoadingView'); - -module.exports = Marionette.Layout.extend({ - template : 'Activity/History/HistoryLayoutTemplate', - - regions : { - history : '#x-history', - toolbar : '#x-history-toolbar', - pager : '#x-history-pager' - }, - - columns : [ - { - name : 'eventType', - label : '', - cell : EventTypeCell, - cellValue : 'this' - }, - { - name : 'movie', - label : 'Movie Title', - cell : MovieTitleCell, - }, - { - name : 'this', - label : 'Quality', - cell : HistoryQualityCell, - sortable : false - }, - { - name : 'date', - label : 'Date', - cell : RelativeDateCell - }, - { - name : 'this', - label : '', - cell : HistoryDetailsCell, - sortable : false - } - ], - - initialize : function() { - this.collection = new HistoryCollection({ tableName : 'history' }); - this.listenTo(this.collection, 'sync', this._showTable); - }, - - onShow : function() { - this.history.show(new LoadingView()); - this._showToolbar(); - }, - - _showTable : function(collection) { - - this.history.show(new Backgrid.Grid({ - columns : this.columns, - collection : collection, - className : 'table table-hover' - })); - - this.pager.show(new GridPager({ - columns : this.columns, - collection : collection - })); - }, - - _showToolbar : function() { - var filterOptions = { - type : 'radio', - storeState : true, - menuKey : 'history.filterMode', - defaultAction : 'all', - items : [ - { - key : 'all', - title : '', - tooltip : 'All', - icon : 'icon-radarr-all', - callback : this._setFilter - }, - { - key : 'grabbed', - title : '', - tooltip : 'Grabbed', - icon : 'icon-radarr-downloading', - callback : this._setFilter - }, - { - key : 'imported', - title : '', - tooltip : 'Imported', - icon : 'icon-radarr-imported', - callback : this._setFilter - }, - { - key : 'failed', - title : '', - tooltip : 'Failed', - icon : 'icon-radarr-download-failed', - callback : this._setFilter - }, - { - key : 'deleted', - title : '', - tooltip : 'Deleted', - icon : 'icon-radarr-deleted', - callback : this._setFilter - } - ] - }; - - this.toolbar.show(new ToolbarLayout({ - right : [ - filterOptions - ], - context : this - })); - }, - - _setFilter : function(buttonContext) { - var mode = buttonContext.model.get('key'); - - this.collection.state.currentPage = 1; - var promise = this.collection.setFilterMode(mode); - - if (buttonContext) { - buttonContext.ui.icon.spinForPromise(promise); - } - } -}); diff --git a/src/UI/Activity/History/HistoryLayoutTemplate.hbs b/src/UI/Activity/History/HistoryLayoutTemplate.hbs deleted file mode 100644 index bffb274fe..000000000 --- a/src/UI/Activity/History/HistoryLayoutTemplate.hbs +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/Activity/History/HistoryModel.js b/src/UI/Activity/History/HistoryModel.js deleted file mode 100644 index e3bc7f242..000000000 --- a/src/UI/Activity/History/HistoryModel.js +++ /dev/null @@ -1,12 +0,0 @@ -var Backbone = require('backbone'); -var MovieModel = require('../../Movies/MovieModel'); - -module.exports = Backbone.Model.extend({ - parse : function(model) { - if (model.movie) { - model.movie = new MovieModel(model.movie); - } - - return model; - } -}); diff --git a/src/UI/Activity/History/HistoryQualityCell.js b/src/UI/Activity/History/HistoryQualityCell.js deleted file mode 100644 index 6130290a6..000000000 --- a/src/UI/Activity/History/HistoryQualityCell.js +++ /dev/null @@ -1,42 +0,0 @@ -var NzbDroneCell = require('../../Cells/NzbDroneCell'); -var _ = require('underscore'); - -module.exports = NzbDroneCell.extend({ - className : 'history-quality-cell', - - render : function() { - - var title = ''; - var quality = this.model.get('quality'); - var revision = quality.revision; - - if (revision.real && revision.real > 0) { - title += ' REAL'; - } - - if (revision.version && revision.version > 1) { - title += ' PROPER'; - } - - title = title.trim(); - - var html = ''; - - if (this.model.get('qualityCutoffNotMet')) { - html = '{1}'.format(title, quality.quality.name); - } else { - html = '{1}'.format(title, quality.quality.name); - } - - if (quality.customFormats.length > 0){ - var formatNames = _.map(quality.customFormats, function(format) { - return format.name; - }); - html += ' {0}'.format(formatNames.join(", ")); - } - - this.$el.html(html); - - return this; - } -}); diff --git a/src/UI/Activity/Queue/ProgressCell.js b/src/UI/Activity/Queue/ProgressCell.js deleted file mode 100644 index 1f69bf017..000000000 --- a/src/UI/Activity/Queue/ProgressCell.js +++ /dev/null @@ -1,23 +0,0 @@ -var NzbDroneCell = require('../../Cells/NzbDroneCell'); - -module.exports = NzbDroneCell.extend({ - className : 'progress-cell', - - render : function() { - this.$el.empty(); - - if (this.cellValue) { - - var status = this.model.get('status').toLowerCase(); - - if (status === 'downloading') { - var progress = 100 - (this.model.get('sizeleft') / this.model.get('size') * 100); - - this.$el.html('
'.format(progress.toFixed(1)) + - '
'.format(progress)); - } - } - - return this; - } -}); diff --git a/src/UI/Activity/Queue/QueueActionsCell.js b/src/UI/Activity/Queue/QueueActionsCell.js deleted file mode 100644 index eb2297fda..000000000 --- a/src/UI/Activity/Queue/QueueActionsCell.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -var $ = require('jquery'); -var _ = require('underscore'); -var vent = require('../../vent'); -var TemplatedCell = require('../../Cells/TemplatedCell'); -var RemoveFromQueueView = require('./RemoveFromQueueView'); - -module.exports = TemplatedCell.extend({ - - template : 'Activity/Queue/QueueActionsCellTemplate', - className : 'queue-actions-cell', - - events : { - 'click .x-remove' : '_remove', - 'click .x-manual-import' : '_manualImport', - 'click .x-grab' : '_grab' - }, - - ui : { - import : '.x-import', - grab : '.x-grab' - }, - - _remove : function() { - var showBlacklist = this.model.get('status') !== 'Pending'; - - vent.trigger(vent.Commands.OpenModalCommand, new RemoveFromQueueView({ - model : this.model, - showBlacklist : showBlacklist - })); - }, - - _manualImport : function () { - vent.trigger(vent.Commands.ShowManualImport, - { - downloadId: this.model.get('downloadId'), - title: this.model.get('title') - }); - }, - - _grab : function() { - var self = this; - var data = _.omit(this.model.toJSON(), 'series', 'episode'); - - var promise = $.ajax({ - url : window.NzbDrone.ApiRoot + '/queue/grab', - type : 'POST', - data : JSON.stringify(data) - }); - - this.$(this.ui.grab).spinForPromise(promise); - - promise.success(function() { - //find models that have the same series id and episode ids and remove them - self.model.trigger('destroy', self.model); - }); - } -}); diff --git a/src/UI/Activity/Queue/QueueActionsCellTemplate.hbs b/src/UI/Activity/Queue/QueueActionsCellTemplate.hbs deleted file mode 100644 index 394520378..000000000 --- a/src/UI/Activity/Queue/QueueActionsCellTemplate.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{{#if_eq status compare="Completed"}} - {{#if_eq trackedDownloadStatus compare="Warning"}} - - {{/if_eq}} -{{/if_eq}} - -{{#if_eq status compare="Pending"}} - - -{{else}} - -{{/if_eq}} diff --git a/src/UI/Activity/Queue/QueueCollection.js b/src/UI/Activity/Queue/QueueCollection.js deleted file mode 100644 index 52c4659ce..000000000 --- a/src/UI/Activity/Queue/QueueCollection.js +++ /dev/null @@ -1,71 +0,0 @@ -var _ = require('underscore'); -var PageableCollection = require('backbone.pageable'); -//var PageableCollection = require('../../Shared/Grid/SonarrPageableCollection'); -var QueueModel = require('./QueueModel'); -var FormatHelpers = require('../../Shared/FormatHelpers'); -var AsSortedCollection = require('../../Mixins/AsSortedCollection'); -var AsPageableCollection = require('../../Mixins/AsPageableCollection'); -var moment = require('moment'); - -require('../../Mixins/backbone.signalr.mixin'); - -var QueueCollection = PageableCollection.extend({ - url : window.NzbDrone.ApiRoot + '/queue', - model : QueueModel, - - state : { - pageSize : 15, - sortKey: 'timeleft' - }, - - mode : 'client', - - findMovie : function(movieId) { - return _.find(this.fullCollection.models, function(queueModel) { - return queueModel.get('movie').id === movieId; - }); - }, - - sortMappings : { - movie : { - sortValue : function(model, attr) { - var movie = model.get(attr); - - return movie.get('sortTitle'); - } - }, - - timeleft : { - sortValue : function(model, attr) { - var eta = model.get('estimatedCompletionTime'); - - if (eta) { - return moment(eta).unix(); - } - - return Number.MAX_VALUE; - } - }, - - sizeleft : { - sortValue : function(model, attr) { - var size = model.get('size'); - var sizeleft = model.get('sizeleft'); - - if (size && sizeleft) { - return sizeleft / size; - } - - return 0; - } - } - } -}); - -QueueCollection = AsSortedCollection.call(QueueCollection); -QueueCollection = AsPageableCollection.call(QueueCollection); - -var collection = new QueueCollection().bindSignalR(); -collection.fetch(); - -module.exports = collection; diff --git a/src/UI/Activity/Queue/QueueLayout.js b/src/UI/Activity/Queue/QueueLayout.js deleted file mode 100644 index 128f6c70c..000000000 --- a/src/UI/Activity/Queue/QueueLayout.js +++ /dev/null @@ -1,84 +0,0 @@ -var Marionette = require('marionette'); -var Backgrid = require('backgrid'); -var QueueCollection = require('./QueueCollection'); -var MovieTitleCell = require('../../Cells/MovieTitleCell'); -var QualityCell = require('../../Cells/QualityCell'); -var QueueStatusCell = require('./QueueStatusCell'); -var QueueActionsCell = require('./QueueActionsCell'); -var TimeleftCell = require('./TimeleftCell'); -var ProgressCell = require('./ProgressCell'); -var ProtocolCell = require('../../Release/ProtocolCell'); -var GridPager = require('../../Shared/Grid/Pager'); - -module.exports = Marionette.Layout.extend({ - template : 'Activity/Queue/QueueLayoutTemplate', - - regions : { - table : '#x-queue', - pager : '#x-queue-pager' - }, - - columns : [ - { - name : 'status', - label : '', - cell : QueueStatusCell, - cellValue : 'this' - }, - { - name : 'movie', - label : 'Movie', - cell : MovieTitleCell - }, - { - name : 'quality', - label : 'Quality', - cell : QualityCell, - sortable : false - }, - { - name : 'protocol', - label : 'Protocol', - cell : ProtocolCell - }, - { - name : 'timeleft', - label : 'Time Left', - cell : TimeleftCell, - cellValue : 'this' - }, - { - name : 'sizeleft', - label : 'Progress', - cell : ProgressCell, - cellValue : 'this' - }, - { - name : 'status', - label : '', - cell : QueueActionsCell, - cellValue : 'this' - } - ], - - initialize : function() { - this.listenTo(QueueCollection, 'sync', this._showTable); - }, - - onShow : function() { - this._showTable(); - }, - - _showTable : function() { - this.table.show(new Backgrid.Grid({ - columns : this.columns, - collection : QueueCollection, - className : 'table table-hover' - })); - - this.pager.show(new GridPager({ - columns : this.columns, - collection : QueueCollection - })); - } -}); diff --git a/src/UI/Activity/Queue/QueueLayoutTemplate.hbs b/src/UI/Activity/Queue/QueueLayoutTemplate.hbs deleted file mode 100644 index e8e6a3c12..000000000 --- a/src/UI/Activity/Queue/QueueLayoutTemplate.hbs +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
-
-
- -
-
-
-
-
\ No newline at end of file diff --git a/src/UI/Activity/Queue/QueueModel.js b/src/UI/Activity/Queue/QueueModel.js deleted file mode 100644 index fc8900be1..000000000 --- a/src/UI/Activity/Queue/QueueModel.js +++ /dev/null @@ -1,9 +0,0 @@ -var Backbone = require('backbone'); -var MovieModel = require('../../Movies/MovieModel'); - -module.exports = Backbone.Model.extend({ - parse : function(model) { - model.movie = new MovieModel(model.movie); - return model; - } -}); diff --git a/src/UI/Activity/Queue/QueueStatusCell.js b/src/UI/Activity/Queue/QueueStatusCell.js deleted file mode 100644 index 58b7001d5..000000000 --- a/src/UI/Activity/Queue/QueueStatusCell.js +++ /dev/null @@ -1,81 +0,0 @@ -var Marionette = require('marionette'); -var NzbDroneCell = require('../../Cells/NzbDroneCell'); - -module.exports = NzbDroneCell.extend({ - className : 'queue-status-cell', - template : 'Activity/Queue/QueueStatusCellTemplate', - - render : function() { - this.$el.empty(); - - if (this.cellValue) { - var status = this.cellValue.get('status').toLowerCase(); - var trackedDownloadStatus = this.cellValue.has('trackedDownloadStatus') ? this.cellValue.get('trackedDownloadStatus').toLowerCase() : 'ok'; - var icon = 'icon-radarr-downloading'; - var title = 'Downloading'; - var itemTitle = this.cellValue.get('title'); - var content = itemTitle; - - if (status === 'paused') { - icon = 'icon-radarr-paused'; - title = 'Paused'; - } - - if (status === 'queued') { - icon = 'icon-radarr-queued'; - title = 'Queued'; - } - - if (status === 'completed') { - icon = 'icon-radarr-downloaded'; - title = 'Downloaded'; - } - - if (status === 'pending') { - icon = 'icon-radarr-pending'; - title = 'Pending'; - } - - if (status === 'failed') { - icon = 'icon-radarr-download-failed'; - title = 'Download failed'; - } - - if (status === 'warning') { - icon = 'icon-radarr-download-warning'; - title = 'Download warning: check download client for more details'; - } - - if (trackedDownloadStatus === 'warning') { - icon += ' icon-radarr-warning'; - - this.templateFunction = Marionette.TemplateCache.get(this.template); - content = this.templateFunction(this.cellValue.toJSON()); - } - - if (trackedDownloadStatus === 'error') { - if (status === 'completed') { - icon = 'icon-radarr-import-failed'; - title = 'Import failed: ' + itemTitle; - } else { - icon = 'icon-radarr-download-failed'; - title = 'Download failed'; - } - - this.templateFunction = Marionette.TemplateCache.get(this.template); - content = this.templateFunction(this.cellValue.toJSON()); - } - - this.$el.html(''.format(icon)); - this.$el.popover({ - content : content, - html : true, - trigger : 'hover', - title : title, - placement : 'right', - container : this.$el - }); - } - return this; - } -}); \ No newline at end of file diff --git a/src/UI/Activity/Queue/QueueStatusCellTemplate.hbs b/src/UI/Activity/Queue/QueueStatusCellTemplate.hbs deleted file mode 100644 index 477fdd028..000000000 --- a/src/UI/Activity/Queue/QueueStatusCellTemplate.hbs +++ /dev/null @@ -1,8 +0,0 @@ -{{#each statusMessages}} - {{title}} -
    - {{#each messages}} -
  • {{this}}
  • - {{/each}} -
-{{/each}} \ No newline at end of file diff --git a/src/UI/Activity/Queue/QueueView.js b/src/UI/Activity/Queue/QueueView.js deleted file mode 100644 index ccddebbc9..000000000 --- a/src/UI/Activity/Queue/QueueView.js +++ /dev/null @@ -1,40 +0,0 @@ -var _ = require('underscore'); -var Marionette = require('marionette'); -var QueueCollection = require('./QueueCollection'); - -module.exports = Marionette.ItemView.extend({ - tagName : 'span', - - initialize : function() { - this.listenTo(QueueCollection, 'sync', this.render); - QueueCollection.fetch(); - }, - - render : function() { - this.$el.empty(); - - if (QueueCollection.length === 0) { - return this; - } - - var count = QueueCollection.fullCollection.length; - var label = 'label-info'; - - var errors = QueueCollection.fullCollection.some(function(model) { - return model.has('trackedDownloadStatus') && model.get('trackedDownloadStatus').toLowerCase() === 'error'; - }); - - var warnings = QueueCollection.fullCollection.some(function(model) { - return model.has('trackedDownloadStatus') && model.get('trackedDownloadStatus').toLowerCase() === 'warning'; - }); - - if (errors) { - label = 'label-danger'; - } else if (warnings) { - label = 'label-warning'; - } - - this.$el.html('{1}'.format(label, count)); - return this; - } -}); \ No newline at end of file diff --git a/src/UI/Activity/Queue/RemoveFromQueueView.js b/src/UI/Activity/Queue/RemoveFromQueueView.js deleted file mode 100644 index 571738d7a..000000000 --- a/src/UI/Activity/Queue/RemoveFromQueueView.js +++ /dev/null @@ -1,34 +0,0 @@ -var vent = require('../../vent'); -var Marionette = require('marionette'); - -module.exports = Marionette.ItemView.extend({ - template : 'Activity/Queue/RemoveFromQueueViewTemplate', - - events : { - 'click .x-confirm-remove' : 'removeItem' - }, - - ui : { - blacklist : '.x-blacklist', - indicator : '.x-indicator' - }, - - initialize : function(options) { - this.templateHelpers = { - showBlacklist : options.showBlacklist - }; - }, - - removeItem : function() { - var blacklist = this.ui.blacklist.prop('checked') || false; - - this.ui.indicator.show(); - - this.model.destroy({ - data : { 'blacklist' : blacklist }, - wait : true - }).done(function() { - vent.trigger(vent.Commands.CloseModalCommand); - }); - } -}); diff --git a/src/UI/Activity/Queue/RemoveFromQueueViewTemplate.hbs b/src/UI/Activity/Queue/RemoveFromQueueViewTemplate.hbs deleted file mode 100644 index 321b67072..000000000 --- a/src/UI/Activity/Queue/RemoveFromQueueViewTemplate.hbs +++ /dev/null @@ -1,49 +0,0 @@ -