|
|
@ -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
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|