Fixed: Improved error messaging for manual import

pull/4/head
Mark McDowall 9 years ago
parent c9f1039ab4
commit 92b87b9d21

@ -93,7 +93,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
if (localEpisode.Episodes.Empty()) if (localEpisode.Episodes.Empty())
{ {
decision = new ImportDecision(localEpisode, new Rejection("Unable to find episodes")); decision = new ImportDecision(localEpisode, new Rejection("Unable to parse episode(s) from filename"));
} }
else else
{ {

@ -23,7 +23,7 @@ module.exports = Backgrid.Cell.extend({
content : html, content : html,
html : true, html : true,
trigger : 'hover', trigger : 'hover',
title : 'Release Rejected', title : this.column.get('title'),
placement : 'left', placement : 'left',
container : this.$el container : this.$el
}); });

@ -59,7 +59,8 @@ module.exports = Marionette.Layout.extend({
cell : ApprovalStatusCell, cell : ApprovalStatusCell,
sortable : true, sortable : true,
sortType : 'fixed', sortType : 'fixed',
direction : 'ascending' direction : 'ascending',
title : 'Release Rejected'
}, },
{ {
name : 'download', name : 'download',

@ -16,6 +16,7 @@ var QualityCell = require('./Cells/QualityCell');
var FileSizeCell = require('../Cells/FileSizeCell'); var FileSizeCell = require('../Cells/FileSizeCell');
var ApprovalStatusCell = require('../Cells/ApprovalStatusCell'); var ApprovalStatusCell = require('../Cells/ApprovalStatusCell');
var ManualImportCollection = require('./ManualImportCollection'); var ManualImportCollection = require('./ManualImportCollection');
var Messenger = require('../Shared/Messenger');
module.exports = Marionette.Layout.extend({ module.exports = Marionette.Layout.extend({
className : 'modal-lg', className : 'modal-lg',
@ -84,7 +85,8 @@ module.exports = Marionette.Layout.extend({
cell : ApprovalStatusCell, cell : ApprovalStatusCell,
sortable : false, sortable : false,
sortType : 'fixed', sortType : 'fixed',
direction : 'ascending' direction : 'ascending',
title : 'Import Rejected'
} }
], ],
@ -170,6 +172,30 @@ module.exports = Marionette.Layout.extend({
return; return;
} }
if (_.any(selected, function (model) {
return !model.has('series');
})) {
this._showErrorMessage('Series must be chosen for each selected file');
return;
}
if (_.any(selected, function (model) {
return !model.has('season');
})) {
this._showErrorMessage('Season must be chosen for each selected file');
return;
}
if (_.any(selected, function (model) {
return !model.has('episodes') || model.get('episodes').length === 0;
})) {
this._showErrorMessage('One or more episodes must be chosen for each selected file');
return;
}
CommandController.Execute('manualImport', { CommandController.Execute('manualImport', {
name : 'manualImport', name : 'manualImport',
files : _.map(selected, function (file) { files : _.map(selected, function (file) {
@ -214,5 +240,13 @@ module.exports = Marionette.Layout.extend({
else { else {
this.ui.importButton.removeAttr('disabled'); this.ui.importButton.removeAttr('disabled');
} }
},
_showErrorMessage : function (message) {
Messenger.show({
message : message,
type : 'error',
hideAfter : 5
});
} }
}); });

@ -50,7 +50,8 @@ module.exports = Marionette.Layout.extend({
{ {
name : 'rejections', name : 'rejections',
label : '', label : '',
cell : ApprovalStatusCell cell : ApprovalStatusCell,
title : 'Release Rejected'
} }
], ],

Loading…
Cancel
Save