Changed: All-around small improvements (#3032)

pull/3041/head
Ricardo Amaral 6 years ago committed by Leonardo Galli
parent 3767bbec18
commit c566c6e18a

@ -7,6 +7,7 @@ using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Reflection; using NzbDrone.Common.Reflection;
using NzbDrone.Core.Annotations; using NzbDrone.Core.Annotations;
using NzbDrone.Core.Download.Clients.Nzbget;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using NzbDrone.Core.Profiles; using NzbDrone.Core.Profiles;
@ -181,6 +182,11 @@ namespace NzbDrone.Api.ClientSchema
var options = from Enum e in Enum.GetValues(selectOptions) var options = from Enum e in Enum.GetValues(selectOptions)
select new SelectOption { Value = Convert.ToInt32(e), Name = e.ToString() }; select new SelectOption { Value = Convert.ToInt32(e), Name = e.ToString() };
if (selectOptions == typeof(NzbgetPriority))
{
return options.OrderBy(o => o.Value).ToList();
}
return options.OrderBy(o => o.Name).ToList(); return options.OrderBy(o => o.Name).ToList();
} }
} }

@ -231,7 +231,6 @@ module.exports = Marionette.Layout.extend({
this.listsDropdown = new DiscoverableListDropdownView(DiscoverableListCollection.toJSON()); this.listsDropdown = new DiscoverableListDropdownView(DiscoverableListCollection.toJSON());
this.listsDropdown.render(); this.listsDropdown.render();
$("#list-dropdown").html(this.listsDropdown.$el.html()); $("#list-dropdown").html(this.listsDropdown.$el.html());
//debugger;
//this.myRegion.show(new DiscoverableListDropdownView(DiscoverableListCollection.toJSON())); //this.myRegion.show(new DiscoverableListDropdownView(DiscoverableListCollection.toJSON()));
}, },

@ -25,7 +25,6 @@ module.exports = Backgrid.SelectCell.extend({
}, },
optionValues : function() { optionValues : function() {
//debugger;
return _.map(ProfileCollection.models, function(model){ return _.map(ProfileCollection.models, function(model){
return [model.get("name"), model.get("id")+""]; return [model.get("name"), model.get("id")+""];
}); });

@ -56,7 +56,6 @@ module.exports = Marionette.Layout.extend({
this.bulkImportCollection.fullCollection.reset(); this.bulkImportCollection.fullCollection.reset();
this.bulkImportCollection.reset(); this.bulkImportCollection.reset();
this.table.show(new LoadingView()); this.table.show(new LoadingView());
//debugger;
this.bulkImportCollection.setPageSize(pageSize); this.bulkImportCollection.setPageSize(pageSize);
//this.bulkImportCollection.fetch(); //this.bulkImportCollection.fetch();
}, },

@ -39,7 +39,6 @@ module.exports = Marionette.CollectionView.extend({
setExisting : function(tmdbid) { setExisting : function(tmdbid) {
var movies = this.collection.where({ tmdbId : tmdbid }); var movies = this.collection.where({ tmdbId : tmdbid });
console.warn(movies); console.warn(movies);
//debugger;
if (movies.length > 0) { if (movies.length > 0) {
this.children.findByModel(movies[0])._configureTemplateHelpers(); this.children.findByModel(movies[0])._configureTemplateHelpers();
//this.children.findByModel(movies[0])._configureTemplateHelpers(); //this.children.findByModel(movies[0])._configureTemplateHelpers();

@ -23,7 +23,6 @@ module.exports = Backgrid.CellEditor.extend({
promise.done(function() { promise.done(function() {
var templateName = self.template; var templateName = self.template;
self.schema = profileSchemaCollection.first(); self.schema = profileSchemaCollection.first();
debugger;
var selected = _.find(self.schema.get('items'), function(model) { var selected = _.find(self.schema.get('items'), function(model) {
return model.quality.id === self.model.get(self.column.get('name')).quality.id; return model.quality.id === self.model.get(self.column.get('name')).quality.id;

@ -2404,7 +2404,6 @@ var Body = Backgrid.Body = Backbone.View.extend({
See [Backbone.Collection#comparator](http://backbonejs.org/#Collection-comparator) See [Backbone.Collection#comparator](http://backbonejs.org/#Collection-comparator)
*/ */
sort: function (column, direction) { sort: function (column, direction) {
//debugger;
if (_.isString(column)) column = this.columns.findWhere({name: column}); if (_.isString(column)) column = this.columns.findWhere({name: column});
var collection = this.collection; var collection = this.collection;

@ -815,7 +815,7 @@
sort: function(options) { sort: function(options) {
if (!this.comparator) throw new Error('Cannot sort a set without a comparator'); if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
options || (options = {}); options || (options = {});
//debugger;
// Run sort based on type of `comparator`. // Run sort based on type of `comparator`.
if (_.isString(this.comparator) || this.comparator.length === 1) { if (_.isString(this.comparator) || this.comparator.length === 1) {
this.models = this.sortBy(this.comparator, this); this.models = this.sortBy(this.comparator, this);

@ -87,7 +87,7 @@ module.exports = Marionette.Layout.extend({
_filter : function (term) { _filter : function (term) {
this.movieCollection.reset(this.fullMovieCollection.filter(function(model){ this.movieCollection.reset(this.fullMovieCollection.filter(function(model){
return (model.get("title") + " "+model.get("year")+"").toLowerCase().indexOf(term.toLowerCase()) != -1; return (model.get("title") + " "+model.get("year")+"").toLowerCase().indexOf(term.toLowerCase()) !== -1;
}).slice(0, 50)); }).slice(0, 50));
this._setModelCollection(); this._setModelCollection();
@ -95,7 +95,6 @@ module.exports = Marionette.Layout.extend({
}, },
_onSelected : function (e) { _onSelected : function (e) {
debugger;
this.trigger('manualimport:selected:movie', { model: e.model }); this.trigger('manualimport:selected:movie', { model: e.model });
vent.trigger(vent.Commands.CloseModal2Command); vent.trigger(vent.Commands.CloseModal2Command);

@ -26,10 +26,10 @@ module.exports = Marionette.ItemView.extend({
}, },
onRender : function() { onRender : function() {
if (this.current.formats != undefined) { if (this.current.formats !== undefined) {
this.ui.formats.val(this.current.formats.map(function(m) {return m.id;}).join(",")); this.ui.formats.val(this.current.formats.map(function(m) {return m.id;}).join(","));
} }
if (this.current.quality != undefined) { if (this.current.quality !== undefined) {
this.ui.select.val(this.current.quality.id); this.ui.select.val(this.current.quality.id);
} }
this.ui.formats.tagInput(); this.ui.formats.tagInput();

@ -3,7 +3,7 @@
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Delete {{title}}</h3> <h3>Delete {{title}}</h3>
</div> </div>
<div class="modal-body delete-series-modal"> <div class="modal-body delete-movie-modal">
<div class="row"> <div class="row">
<div class="col-sm-3 hidden-xs"> <div class="col-sm-3 hidden-xs">

@ -3,7 +3,7 @@
<button type="button" class="close" data-dismiss="modal" aria-label="close">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-label="close">&times;</button>
<h3>Delete {{removeCount}} Titles</h3> <h3>Delete {{removeCount}} Titles</h3>
</div> </div>
<div class="modal-body delete-series-modal"> <div class="modal-body delete-movie-modal">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="form-horizontal"> <div class="form-horizontal">

@ -12,7 +12,7 @@
Are you sure you want to update all files in the {{numberOfMovies}} selected movies? Are you sure you want to update all files in the {{numberOfMovies}} selected movies?
<ul class="selected-series"> <ul class="selected-movie">
{{#each movies}} {{#each movies}}
<li>{{title}}</li> <li>{{title}}</li>
{{/each}} {{/each}}

@ -145,7 +145,6 @@ module.exports = Marionette.Layout.extend({
initialize : function() { initialize : function() {
//this variable prevents us from showing the list before moviesCollection has been fetched the first time //this variable prevents us from showing the list before moviesCollection has been fetched the first time
this.moviesCollection = MoviesCollection.clone(); this.moviesCollection = MoviesCollection.clone();
//debugger;
this.moviesCollection.bindSignalR(); this.moviesCollection.bindSignalR();
var pageSize = parseInt(Config.getValue("pageSize")) || 10; var pageSize = parseInt(Config.getValue("pageSize")) || 10;
if (this.moviesCollection.state.pageSize !== pageSize) { if (this.moviesCollection.state.pageSize !== pageSize) {
@ -321,7 +320,6 @@ module.exports = Marionette.Layout.extend({
}; };
//this._showToolbar(); //this._showToolbar();
//debugger;
var self = this; var self = this;
setTimeout(function(){self._showToolbar();}, 0); // jshint ignore:line setTimeout(function(){self._showToolbar();}, 0); // jshint ignore:line
//this._renderView(); //this._renderView();
@ -397,7 +395,6 @@ module.exports = Marionette.Layout.extend({
}, },
_showToolbar : function() { _showToolbar : function() {
//debugger;
if (this.toolbar.currentView) { if (this.toolbar.currentView) {
return; return;
} }

@ -26,7 +26,6 @@ module.exports = NzbDroneController.extend({
if(FullMovieCollection.length > 0) { if(FullMovieCollection.length > 0) {
this._renderMovieDetails(query); this._renderMovieDetails(query);
//debugger;
} else { } else {
var self = this; var self = this;
$.getJSON(window.NzbDrone.ApiRoot + '/movie/titleslug/'+query, { }, function(data) { $.getJSON(window.NzbDrone.ApiRoot + '/movie/titleslug/'+query, { }, function(data) {
@ -34,7 +33,6 @@ module.exports = NzbDroneController.extend({
self._renderMovieDetails(query); self._renderMovieDetails(query);
}); });
this.listenTo(FullMovieCollection, 'sync', function(model, options) { this.listenTo(FullMovieCollection, 'sync', function(model, options) {
//debugger;
this._renderMovieDetails(query); this._renderMovieDetails(query);
}); });
} }

@ -156,7 +156,7 @@
width : 170px; width : 170px;
:hover { :hover {
cursor : default; cursor : pointer;
} }
.label { .label {

@ -2,7 +2,7 @@ var vent = require('vent');
var Marionette = require('marionette'); var Marionette = require('marionette');
module.exports = Marionette.ItemView.extend({ module.exports = Marionette.ItemView.extend({
template : 'Settings/Indexers/Delete/IndexerDeleteViewTemplate', template : 'Settings/NetImport/Delete/NetImportDeleteViewTemplate',
events : { events : {
'click .x-confirm-delete' : '_delete' 'click .x-confirm-delete' : '_delete'

@ -1,7 +1,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Delete Indexer</h3> <h3>Delete List</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>Are you sure you want to delete '{{name}}'?</p> <p>Are you sure you want to delete '{{name}}'?</p>

@ -3,7 +3,7 @@ var $ = require('jquery');
var vent = require('vent'); var vent = require('vent');
var AppLayout = require('../../../AppLayout'); var AppLayout = require('../../../AppLayout');
var Marionette = require('marionette'); var Marionette = require('marionette');
var DeleteView = require('../Delete/IndexerDeleteView'); var DeleteView = require('../Delete/NetImportDeleteView');
var Profiles = require('../../../Profile/ProfileCollection'); var Profiles = require('../../../Profile/ProfileCollection');
var AsModelBoundView = require('../../../Mixins/AsModelBoundView'); var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
var AsValidatedView = require('../../../Mixins/AsValidatedView'); var AsValidatedView = require('../../../Mixins/AsValidatedView');

@ -30,7 +30,7 @@ var view = Marionette.Layout.extend({
initialize : function(options) { initialize : function(options) {
this.profileCollection = options.profileCollection; this.profileCollection = options.profileCollection;
this.itemsCollection = new Backbone.Collection(_.toArray(this.model.get('items')).reverse()); this.itemsCollection = new Backbone.Collection(_.toArray(this.model.get('items')).reverse());
this.netImportCollection = new NetImportCollection; this.netImportCollection = new NetImportCollection();
this.netImportCollection.fetch(); this.netImportCollection.fetch();
this.formatItemsCollection = new Backbone.Collection(_.toArray(this.model.get('formatItems')).reverse()); this.formatItemsCollection = new Backbone.Collection(_.toArray(this.model.get('formatItems')).reverse());
this.listenTo(FullMovieCollection, 'all', this._updateDisableStatus); this.listenTo(FullMovieCollection, 'all', this._updateDisableStatus);

@ -94,7 +94,7 @@ var view = Marionette.ItemView.extend({
var input = this.ui.thirtyMinuteMaxSize.val(); var input = this.ui.thirtyMinuteMaxSize.val();
var maxSize = parseFloat(input) || 0; var maxSize = parseFloat(input) || 0;
var mbPerMinute = maxSize / 90 * 1024; var mbPerMinute = maxSize / 90 * 1024;
if (mbPerMinute == 0) if (mbPerMinute === 0)
{ {
mbPerMinute = null; mbPerMinute = null;
} }

Loading…
Cancel
Save