mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
parent
254561aeb1
commit
90e58e5a22
@ -42,8 +42,7 @@ class DeleteMovieModalContent extends Component {
|
||||
const deleteFiles = this.state.deleteFiles;
|
||||
const addNetImportExclusion = this.state.addNetImportExclusion;
|
||||
|
||||
this.setState({ deleteFiles: false });
|
||||
this.setState({ addNetImportExclusion: false });
|
||||
this.setState({ deleteFiles: false, addNetImportExclusion: false });
|
||||
this.props.onDeletePress(deleteFiles, addNetImportExclusion);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,8 @@ class DeleteMovieModalContent extends Component {
|
||||
super(props, context);
|
||||
|
||||
this.state = {
|
||||
deleteFiles: false
|
||||
deleteFiles: false,
|
||||
addNetImportExclusion: false
|
||||
};
|
||||
}
|
||||
|
||||
@ -31,11 +32,16 @@ class DeleteMovieModalContent extends Component {
|
||||
this.setState({ deleteFiles: value });
|
||||
}
|
||||
|
||||
onAddNetImportExclusionChange = ({ value }) => {
|
||||
this.setState({ addNetImportExclusion: value });
|
||||
}
|
||||
|
||||
onDeleteMovieConfirmed = () => {
|
||||
const deleteFiles = this.state.deleteFiles;
|
||||
const addNetImportExclusion = this.state.addNetImportExclusion;
|
||||
|
||||
this.setState({ deleteFiles: false });
|
||||
this.props.onDeleteSelectedPress(deleteFiles);
|
||||
this.setState({ deleteFiles: false, addNetImportExclusion: false });
|
||||
this.props.onDeleteSelectedPress(deleteFiles, addNetImportExclusion);
|
||||
}
|
||||
|
||||
//
|
||||
@ -46,7 +52,9 @@ class DeleteMovieModalContent extends Component {
|
||||
movies,
|
||||
onModalClose
|
||||
} = this.props;
|
||||
|
||||
const deleteFiles = this.state.deleteFiles;
|
||||
const addNetImportExclusion = this.state.addNetImportExclusion;
|
||||
|
||||
return (
|
||||
<ModalContent onModalClose={onModalClose}>
|
||||
@ -68,6 +76,19 @@ class DeleteMovieModalContent extends Component {
|
||||
onChange={this.onDeleteFilesChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Add List Exclusion</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="addNetImportExclusion"
|
||||
value={addNetImportExclusion}
|
||||
helpText="Prevent movie from being added to Radarr by lists"
|
||||
kind={kinds.DANGER}
|
||||
onChange={this.onAddNetImportExclusionChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
</div>
|
||||
|
||||
<div className={styles.message}>
|
||||
|
@ -31,10 +31,11 @@ function createMapStateToProps() {
|
||||
|
||||
function createMapDispatchToProps(dispatch, props) {
|
||||
return {
|
||||
onDeleteSelectedPress(deleteFiles) {
|
||||
onDeleteSelectedPress(deleteFiles, addNetImportExclusion) {
|
||||
dispatch(bulkDeleteMovie({
|
||||
movieIds: props.movieIds,
|
||||
deleteFiles
|
||||
deleteFiles,
|
||||
addNetImportExclusion
|
||||
}));
|
||||
|
||||
props.onModalClose();
|
||||
|
@ -1,3 +1,4 @@
|
||||
import $ from 'jquery';
|
||||
import { createAction } from 'redux-actions';
|
||||
import { batchActions } from 'redux-batched-actions';
|
||||
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
||||
@ -355,13 +356,18 @@ export const actionHandlers = handleThunks({
|
||||
},
|
||||
|
||||
[BULK_DELETE_MOVIE]: function(getState, payload, dispatch) {
|
||||
const {
|
||||
id,
|
||||
...queryParams
|
||||
} = payload;
|
||||
|
||||
dispatch(set({
|
||||
section,
|
||||
isDeleting: true
|
||||
}));
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/movie/editor',
|
||||
url: `/movie/editor?${$.param(queryParams, true)}`,
|
||||
method: 'DELETE',
|
||||
data: JSON.stringify(payload),
|
||||
dataType: 'json'
|
||||
|
@ -89,9 +89,12 @@ private object DeleteMovies()
|
||||
{
|
||||
var resource = Request.Body.FromJson<MovieEditorResource>();
|
||||
|
||||
var addExclusion = Request.GetBooleanQueryParameter("addNetImportExclusion");
|
||||
var deleteFiles = Request.GetBooleanQueryParameter("deleteFiles");
|
||||
|
||||
foreach (var id in resource.MovieIds)
|
||||
{
|
||||
_movieService.DeleteMovie(id, false, false);
|
||||
_movieService.DeleteMovie(id, deleteFiles, addExclusion);
|
||||
}
|
||||
|
||||
return new object();
|
||||
|
@ -116,16 +116,9 @@ private void UpdateMovie(MovieResource moviesResource)
|
||||
|
||||
private void DeleteMovie(int id)
|
||||
{
|
||||
var addExclusion = false;
|
||||
var addExclusionQuery = Request.Query.addNetImportExclusion;
|
||||
|
||||
var addExclusion = Request.GetBooleanQueryParameter("addNetImportExclusion");
|
||||
var deleteFiles = Request.GetBooleanQueryParameter("deleteFiles");
|
||||
|
||||
if (addExclusionQuery.HasValue)
|
||||
{
|
||||
addExclusion = Convert.ToBoolean(addExclusionQuery.Value);
|
||||
}
|
||||
|
||||
_moviesService.DeleteMovie(id, deleteFiles, addExclusion);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user