mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 16:13:58 -07:00
Add: option to skip automatic redownload when removing from queue (#734)
* Add: option to skip automatic redownload when removing from queue * Add tests for RedownloadFailedDownloadService * Fix formatting * Make re-download dialog conditional
This commit is contained in:
parent
0f6a3bca0c
commit
8cd9ab4a9f
13 changed files with 230 additions and 35 deletions
|
@ -107,8 +107,8 @@ class Queue extends Component {
|
|||
this.setState({ isConfirmRemoveModalOpen: true });
|
||||
}
|
||||
|
||||
onRemoveSelectedConfirmed = (blacklist) => {
|
||||
this.props.onRemoveSelectedPress(this.getSelectedIds(), blacklist);
|
||||
onRemoveSelectedConfirmed = (blacklist, skipredownload) => {
|
||||
this.props.onRemoveSelectedPress(this.getSelectedIds(), blacklist, skipredownload);
|
||||
this.setState({ isConfirmRemoveModalOpen: false });
|
||||
}
|
||||
|
||||
|
|
|
@ -137,8 +137,8 @@ class QueueConnector extends Component {
|
|||
this.props.grabQueueItems({ ids });
|
||||
}
|
||||
|
||||
onRemoveSelectedPress = (ids, blacklist) => {
|
||||
this.props.removeQueueItems({ ids, blacklist });
|
||||
onRemoveSelectedPress = (ids, blacklist, skipredownload) => {
|
||||
this.props.removeQueueItems({ ids, blacklist, skipredownload });
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -42,8 +42,8 @@ class QueueRow extends Component {
|
|||
this.setState({ isRemoveQueueItemModalOpen: true });
|
||||
}
|
||||
|
||||
onRemoveQueueItemModalConfirmed = (blacklist) => {
|
||||
this.props.onRemoveQueueItemPress(blacklist);
|
||||
onRemoveQueueItemModalConfirmed = (blacklist, skipredownload) => {
|
||||
this.props.onRemoveQueueItemPress(blacklist, skipredownload);
|
||||
this.setState({ isRemoveQueueItemModalOpen: false });
|
||||
}
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ class QueueRowConnector extends Component {
|
|||
this.props.grabQueueItem({ id: this.props.id });
|
||||
}
|
||||
|
||||
onRemoveQueueItemPress = (blacklist) => {
|
||||
this.props.removeQueueItem({ id: this.props.id, blacklist });
|
||||
onRemoveQueueItemPress = (blacklist, skipredownload) => {
|
||||
this.props.removeQueueItem({ id: this.props.id, blacklist, skipredownload });
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -21,7 +21,8 @@ class RemoveQueueItemModal extends Component {
|
|||
super(props, context);
|
||||
|
||||
this.state = {
|
||||
blacklist: false
|
||||
blacklist: false,
|
||||
skipredownload: false
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,15 +33,26 @@ class RemoveQueueItemModal extends Component {
|
|||
this.setState({ blacklist: value });
|
||||
}
|
||||
|
||||
onSkipReDownloadChange = ({ value }) => {
|
||||
this.setState({ skipredownload: value });
|
||||
}
|
||||
|
||||
onRemoveQueueItemConfirmed = () => {
|
||||
const blacklist = this.state.blacklist;
|
||||
const skipredownload = this.state.skipredownload;
|
||||
|
||||
this.setState({ blacklist: false });
|
||||
this.props.onRemovePress(blacklist);
|
||||
this.setState({
|
||||
blacklist: false,
|
||||
skipredownload: false
|
||||
});
|
||||
this.props.onRemovePress(blacklist, skipredownload);
|
||||
}
|
||||
|
||||
onModalClose = () => {
|
||||
this.setState({ blacklist: false });
|
||||
this.setState({
|
||||
blacklist: false,
|
||||
skipredownload: false
|
||||
});
|
||||
this.props.onModalClose();
|
||||
}
|
||||
|
||||
|
@ -54,6 +66,7 @@ class RemoveQueueItemModal extends Component {
|
|||
} = this.props;
|
||||
|
||||
const blacklist = this.state.blacklist;
|
||||
const skipredownload = this.state.skipredownload;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
@ -79,11 +92,25 @@ class RemoveQueueItemModal extends Component {
|
|||
type={inputTypes.CHECK}
|
||||
name="blacklist"
|
||||
value={blacklist}
|
||||
helpText="Prevents Lidarr from automatically grabbing these files again"
|
||||
helpText="Prevents Lidarr from automatically grabbing this release again"
|
||||
onChange={this.onBlacklistChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
{
|
||||
blacklist &&
|
||||
<FormGroup>
|
||||
<FormLabel>Skip Redownload</FormLabel>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="skipredownload"
|
||||
value={skipredownload}
|
||||
helpText="Prevents Lidarr from trying download an alternative release for this item"
|
||||
onChange={this.onSkipReDownloadChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
}
|
||||
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter>
|
||||
|
|
|
@ -21,7 +21,8 @@ class RemoveQueueItemsModal extends Component {
|
|||
super(props, context);
|
||||
|
||||
this.state = {
|
||||
blacklist: false
|
||||
blacklist: false,
|
||||
skipredownload: false
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,15 +33,26 @@ class RemoveQueueItemsModal extends Component {
|
|||
this.setState({ blacklist: value });
|
||||
}
|
||||
|
||||
onSkipReDownloadChange = ({ value }) => {
|
||||
this.setState({ skipredownload: value });
|
||||
}
|
||||
|
||||
onRemoveQueueItemConfirmed = () => {
|
||||
const blacklist = this.state.blacklist;
|
||||
const skipredownload = this.state.skipredownload;
|
||||
|
||||
this.setState({ blacklist: false });
|
||||
this.props.onRemovePress(blacklist);
|
||||
this.setState({
|
||||
blacklist: false,
|
||||
skipredownload: false
|
||||
});
|
||||
this.props.onRemovePress(blacklist, skipredownload);
|
||||
}
|
||||
|
||||
onModalClose = () => {
|
||||
this.setState({ blacklist: false });
|
||||
this.setState({
|
||||
blacklist: false,
|
||||
skipredownload: false
|
||||
});
|
||||
this.props.onModalClose();
|
||||
}
|
||||
|
||||
|
@ -54,6 +66,7 @@ class RemoveQueueItemsModal extends Component {
|
|||
} = this.props;
|
||||
|
||||
const blacklist = this.state.blacklist;
|
||||
const skipredownload = this.state.skipredownload;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
@ -79,11 +92,25 @@ class RemoveQueueItemsModal extends Component {
|
|||
type={inputTypes.CHECK}
|
||||
name="blacklist"
|
||||
value={blacklist}
|
||||
helpText="Prevents Lidarr from automatically grabbing this release again"
|
||||
helpText="Prevents Lidarr from automatically grabbing these files again"
|
||||
onChange={this.onBlacklistChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
{
|
||||
blacklist &&
|
||||
<FormGroup>
|
||||
<FormLabel>Skip Redownload</FormLabel>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="skipredownload"
|
||||
value={skipredownload}
|
||||
helpText="Prevents Lidarr from trying download alternative releases for the removed items"
|
||||
onChange={this.onSkipReDownloadChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
}
|
||||
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter>
|
||||
|
|
|
@ -351,13 +351,14 @@ export const actionHandlers = handleThunks({
|
|||
[REMOVE_QUEUE_ITEM]: function(getState, payload, dispatch) {
|
||||
const {
|
||||
id,
|
||||
blacklist
|
||||
blacklist,
|
||||
skipredownload
|
||||
} = payload;
|
||||
|
||||
dispatch(updateItem({ section: paged, id, isRemoving: true }));
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: `/queue/${id}?blacklist=${blacklist}`,
|
||||
url: `/queue/${id}?blacklist=${blacklist}&skipredownload=${skipredownload}`,
|
||||
method: 'DELETE'
|
||||
}).request;
|
||||
|
||||
|
@ -373,7 +374,8 @@ export const actionHandlers = handleThunks({
|
|||
[REMOVE_QUEUE_ITEMS]: function(getState, payload, dispatch) {
|
||||
const {
|
||||
ids,
|
||||
blacklist
|
||||
blacklist,
|
||||
skipredownload
|
||||
} = payload;
|
||||
|
||||
dispatch(batchActions([
|
||||
|
@ -389,7 +391,7 @@ export const actionHandlers = handleThunks({
|
|||
]));
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: `/queue/bulk?blacklist=${blacklist}`,
|
||||
url: `/queue/bulk?blacklist=${blacklist}&skipredownload=${skipredownload}`,
|
||||
method: 'DELETE',
|
||||
dataType: 'json',
|
||||
data: JSON.stringify({ ids })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue