mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-24 22:36:19 -04:00
Manual Import: Reprocess after selecting series
New: Reprocess changed items when series is changed Closes #1893
This commit is contained in:
+17
-17
@@ -19,11 +19,11 @@ function createMapStateToProps() {
|
||||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
fetchInteractiveImportItems,
|
||||
setInteractiveImportSort,
|
||||
setInteractiveImportMode,
|
||||
clearInteractiveImport,
|
||||
executeCommand
|
||||
dispatchFetchInteractiveImportItems: fetchInteractiveImportItems,
|
||||
dispatchSetInteractiveImportSort: setInteractiveImportSort,
|
||||
dispatchSetInteractiveImportMode: setInteractiveImportMode,
|
||||
dispatchClearInteractiveImport: clearInteractiveImport,
|
||||
dispatchExecuteCommand: executeCommand
|
||||
};
|
||||
|
||||
class InteractiveImportModalContentConnector extends Component {
|
||||
@@ -50,7 +50,7 @@ class InteractiveImportModalContentConnector extends Component {
|
||||
filterExistingFiles
|
||||
} = this.state;
|
||||
|
||||
this.props.fetchInteractiveImportItems({
|
||||
this.props.dispatchFetchInteractiveImportItems({
|
||||
downloadId,
|
||||
folder,
|
||||
filterExistingFiles
|
||||
@@ -68,7 +68,7 @@ class InteractiveImportModalContentConnector extends Component {
|
||||
folder
|
||||
} = this.props;
|
||||
|
||||
this.props.fetchInteractiveImportItems({
|
||||
this.props.dispatchFetchInteractiveImportItems({
|
||||
downloadId,
|
||||
folder,
|
||||
filterExistingFiles
|
||||
@@ -77,14 +77,14 @@ class InteractiveImportModalContentConnector extends Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.clearInteractiveImport();
|
||||
this.props.dispatchClearInteractiveImport();
|
||||
}
|
||||
|
||||
//
|
||||
// Listeners
|
||||
|
||||
onSortPress = (sortKey, sortDirection) => {
|
||||
this.props.setInteractiveImportSort({ sortKey, sortDirection });
|
||||
this.props.dispatchSetInteractiveImportSort({ sortKey, sortDirection });
|
||||
}
|
||||
|
||||
onFilterExistingFilesChange = (filterExistingFiles) => {
|
||||
@@ -92,7 +92,7 @@ class InteractiveImportModalContentConnector extends Component {
|
||||
}
|
||||
|
||||
onImportModeChange = (importMode) => {
|
||||
this.props.setInteractiveImportMode({ importMode });
|
||||
this.props.dispatchSetInteractiveImportMode({ importMode });
|
||||
}
|
||||
|
||||
onImportSelectedPress = (selected, importMode) => {
|
||||
@@ -139,7 +139,7 @@ class InteractiveImportModalContentConnector extends Component {
|
||||
path: item.path,
|
||||
folderName: item.folderName,
|
||||
seriesId: series.id,
|
||||
episodeIds: _.map(episodes, 'id'),
|
||||
episodeIds: episodes.map((e) => e.id),
|
||||
quality,
|
||||
language,
|
||||
downloadId: this.props.downloadId
|
||||
@@ -151,7 +151,7 @@ class InteractiveImportModalContentConnector extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
this.props.executeCommand({
|
||||
this.props.dispatchExecuteCommand({
|
||||
name: commandNames.INTERACTIVE_IMPORT,
|
||||
files,
|
||||
importMode
|
||||
@@ -188,11 +188,11 @@ InteractiveImportModalContentConnector.propTypes = {
|
||||
folder: PropTypes.string,
|
||||
filterExistingFiles: PropTypes.bool.isRequired,
|
||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
fetchInteractiveImportItems: PropTypes.func.isRequired,
|
||||
setInteractiveImportSort: PropTypes.func.isRequired,
|
||||
clearInteractiveImport: PropTypes.func.isRequired,
|
||||
setInteractiveImportMode: PropTypes.func.isRequired,
|
||||
executeCommand: PropTypes.func.isRequired,
|
||||
dispatchFetchInteractiveImportItems: PropTypes.func.isRequired,
|
||||
dispatchSetInteractiveImportSort: PropTypes.func.isRequired,
|
||||
dispatchSetInteractiveImportMode: PropTypes.func.isRequired,
|
||||
dispatchClearInteractiveImport: PropTypes.func.isRequired,
|
||||
dispatchExecuteCommand: PropTypes.func.isRequired,
|
||||
onModalClose: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
.relativePath {
|
||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||
composes: cell from "~Components/Table/Cells/TableRowCell.css";
|
||||
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.quality,
|
||||
.language {
|
||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||
composes: cell from "~Components/Table/Cells/TableRowCell.css";
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.label {
|
||||
composes: label from '~Components/Label.css';
|
||||
composes: label from "~Components/Label.css";
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.reprocessing {
|
||||
composes: loading from "~Components/Loading/LoadingIndicator.css";
|
||||
|
||||
margin-top: 0;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
|
||||
import { icons, kinds, tooltipPositions } from 'Helpers/Props';
|
||||
import Icon from 'Components/Icon';
|
||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||
import TableRow from 'Components/Table/TableRow';
|
||||
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
||||
import TableRowCellButton from 'Components/Table/Cells/TableRowCellButton';
|
||||
@@ -172,6 +173,7 @@ class InteractiveImportRow extends Component {
|
||||
language,
|
||||
size,
|
||||
rejections,
|
||||
isReprocessing,
|
||||
isSelected,
|
||||
onSelectedChange
|
||||
} = this.props;
|
||||
@@ -189,7 +191,7 @@ class InteractiveImportRow extends Component {
|
||||
.join(', ');
|
||||
|
||||
const showSeriesPlaceholder = isSelected && !series;
|
||||
const showSeasonNumberPlaceholder = isSelected && !!series && isNaN(seasonNumber);
|
||||
const showSeasonNumberPlaceholder = isSelected && !!series && isNaN(seasonNumber) && !isReprocessing;
|
||||
const showEpisodeNumbersPlaceholder = isSelected && Number.isInteger(seasonNumber) && !episodes.length;
|
||||
const showQualityPlaceholder = isSelected && !quality;
|
||||
const showLanguagePlaceholder = isSelected && !language;
|
||||
@@ -227,6 +229,15 @@ class InteractiveImportRow extends Component {
|
||||
{
|
||||
showSeasonNumberPlaceholder ? <InteractiveImportRowCellPlaceholder /> : seasonNumber
|
||||
}
|
||||
|
||||
{
|
||||
isReprocessing && seasonNumber == null ?
|
||||
<LoadingIndicator className={styles.reprocessing}
|
||||
size={20}
|
||||
|
||||
/> : null
|
||||
}
|
||||
|
||||
</TableRowCellButton>
|
||||
|
||||
<TableRowCellButton
|
||||
@@ -363,6 +374,7 @@ InteractiveImportRow.propTypes = {
|
||||
language: PropTypes.object,
|
||||
size: PropTypes.number.isRequired,
|
||||
rejections: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
isReprocessing: PropTypes.bool,
|
||||
isSelected: PropTypes.bool,
|
||||
onSelectedChange: PropTypes.func.isRequired,
|
||||
onValidRowChange: PropTypes.func.isRequired
|
||||
|
||||
Reference in New Issue
Block a user