mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
New: Health Check Failure Notifications (#609)
* New: Health Check Failure Notifications Fixes #295 * New: OnDownloadFailure and OnImportFailure Notification * New: On Retag notifications * Fixed: XBMC notification test * New: Discord Notifications Closes #1511 * On Download to On Import on card * Remove OnDownload, Rename OnAlbumDownload -> OnReleaseImported * Fixed: Webhook OnReleaseImport notification * Respect OnUpgrade and fix missing schema items for frontend * New: Simplify Notification Modal UI * Fixed: PlexHomeTheater OnReleaseImport notification
This commit is contained in:
parent
4d8bcd12e3
commit
d4d9146599
52 changed files with 1262 additions and 427 deletions
|
@ -14,6 +14,7 @@ import FormGroup from 'Components/Form/FormGroup';
|
|||
import FormLabel from 'Components/Form/FormLabel';
|
||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
||||
import ProviderFieldFormGroup from 'Components/Form/ProviderFieldFormGroup';
|
||||
import NotificationEventItems from './NotificationEventItems';
|
||||
import styles from './EditNotificationModalContent.css';
|
||||
|
||||
function EditNotificationModalContent(props) {
|
||||
|
@ -38,16 +39,6 @@ function EditNotificationModalContent(props) {
|
|||
id,
|
||||
implementationName,
|
||||
name,
|
||||
onGrab,
|
||||
onDownload,
|
||||
onAlbumDownload,
|
||||
onUpgrade,
|
||||
onRename,
|
||||
supportsOnGrab,
|
||||
supportsOnDownload,
|
||||
supportsOnAlbumDownload,
|
||||
supportsOnUpgrade,
|
||||
supportsOnRename,
|
||||
tags,
|
||||
fields,
|
||||
message
|
||||
|
@ -94,73 +85,10 @@ function EditNotificationModalContent(props) {
|
|||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>On Grab</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onGrab"
|
||||
helpText="Be notified when albums are available for download and has been sent to a download client"
|
||||
isDisabled={!supportsOnGrab.value}
|
||||
{...onGrab}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>On Album Import</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onAlbumDownload"
|
||||
helpText="Be notified when complete albums are successfully imported"
|
||||
isDisabled={!supportsOnAlbumDownload.value}
|
||||
{...onAlbumDownload}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>On Track Import</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onDownload"
|
||||
helpText="Be notified when track files are successfully imported"
|
||||
isDisabled={!supportsOnDownload.value}
|
||||
{...onDownload}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
{
|
||||
onDownload.value &&
|
||||
<FormGroup>
|
||||
<FormLabel>On Track Upgrade</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onUpgrade"
|
||||
helpText="Be notified when tracks are upgraded to a better quality"
|
||||
isDisabled={!supportsOnUpgrade.value}
|
||||
{...onUpgrade}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
}
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>On Rename</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onRename"
|
||||
helpText="Be notified when tracks are renamed"
|
||||
isDisabled={!supportsOnRename.value}
|
||||
{...onRename}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
<NotificationEventItems
|
||||
item={item}
|
||||
onInputChange={onInputChange}
|
||||
/>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Tags</FormLabel>
|
||||
|
|
|
@ -55,15 +55,21 @@ class Notification extends Component {
|
|||
id,
|
||||
name,
|
||||
onGrab,
|
||||
onDownload,
|
||||
onAlbumDownload,
|
||||
onReleaseImport,
|
||||
onUpgrade,
|
||||
onRename,
|
||||
onHealthIssue,
|
||||
onDownloadFailure,
|
||||
onImportFailure,
|
||||
onTrackRetag,
|
||||
supportsOnGrab,
|
||||
supportsOnDownload,
|
||||
supportsOnAlbumDownload,
|
||||
supportsOnReleaseImport,
|
||||
supportsOnUpgrade,
|
||||
supportsOnRename
|
||||
supportsOnRename,
|
||||
supportsOnHealthIssue,
|
||||
supportsOnDownloadFailure,
|
||||
supportsOnImportFailure,
|
||||
supportsOnTrackRetag
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
|
@ -84,21 +90,14 @@ class Notification extends Component {
|
|||
}
|
||||
|
||||
{
|
||||
supportsOnAlbumDownload && onAlbumDownload &&
|
||||
supportsOnReleaseImport && onReleaseImport &&
|
||||
<Label kind={kinds.SUCCESS}>
|
||||
On Album Download
|
||||
On Release Import
|
||||
</Label>
|
||||
}
|
||||
|
||||
{
|
||||
supportsOnDownload && onDownload &&
|
||||
<Label kind={kinds.SUCCESS}>
|
||||
On Download
|
||||
</Label>
|
||||
}
|
||||
|
||||
{
|
||||
supportsOnUpgrade && onDownload && onUpgrade &&
|
||||
supportsOnUpgrade && onReleaseImport && onUpgrade &&
|
||||
<Label kind={kinds.SUCCESS}>
|
||||
On Upgrade
|
||||
</Label>
|
||||
|
@ -112,7 +111,36 @@ class Notification extends Component {
|
|||
}
|
||||
|
||||
{
|
||||
!onGrab && !onAlbumDownload && !onDownload && !onRename &&
|
||||
supportsOnTrackRetag && onTrackRetag &&
|
||||
<Label kind={kinds.SUCCESS}>
|
||||
On Track Tag Update
|
||||
</Label>
|
||||
}
|
||||
|
||||
{
|
||||
supportsOnHealthIssue && onHealthIssue &&
|
||||
<Label kind={kinds.SUCCESS}>
|
||||
On Health Issue
|
||||
</Label>
|
||||
}
|
||||
|
||||
{
|
||||
supportsOnDownloadFailure && onDownloadFailure &&
|
||||
<Label kind={kinds.SUCCESS} >
|
||||
On Download Failure
|
||||
</Label>
|
||||
}
|
||||
|
||||
{
|
||||
supportsOnImportFailure && onImportFailure &&
|
||||
<Label kind={kinds.SUCCESS} >
|
||||
On Import Failure
|
||||
</Label>
|
||||
}
|
||||
|
||||
{
|
||||
!onGrab && !onReleaseImport && !onRename && !onTrackRetag &&
|
||||
!onHealthIssue && !onDownloadFailure && !onImportFailure &&
|
||||
<Label
|
||||
kind={kinds.DISABLED}
|
||||
outline={true}
|
||||
|
@ -146,15 +174,21 @@ Notification.propTypes = {
|
|||
id: PropTypes.number.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
onGrab: PropTypes.bool.isRequired,
|
||||
onDownload: PropTypes.bool.isRequired,
|
||||
onAlbumDownload: PropTypes.bool.isRequired,
|
||||
onReleaseImport: PropTypes.bool.isRequired,
|
||||
onUpgrade: PropTypes.bool.isRequired,
|
||||
onRename: PropTypes.bool.isRequired,
|
||||
onHealthIssue: PropTypes.bool.isRequired,
|
||||
onDownloadFailure: PropTypes.bool.isRequired,
|
||||
onImportFailure: PropTypes.bool.isRequired,
|
||||
onTrackRetag: PropTypes.bool.isRequired,
|
||||
supportsOnGrab: PropTypes.bool.isRequired,
|
||||
supportsOnDownload: PropTypes.bool.isRequired,
|
||||
supportsOnAlbumDownload: PropTypes.bool.isRequired,
|
||||
supportsOnReleaseImport: PropTypes.bool.isRequired,
|
||||
supportsOnUpgrade: PropTypes.bool.isRequired,
|
||||
supportsOnRename: PropTypes.bool.isRequired,
|
||||
supportsOnHealthIssue: PropTypes.bool.isRequired,
|
||||
supportsOnDownloadFailure: PropTypes.bool.isRequired,
|
||||
supportsOnImportFailure: PropTypes.bool.isRequired,
|
||||
supportsOnTrackRetag: PropTypes.bool.isRequired,
|
||||
onConfirmDeleteNotification: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
.events {
|
||||
margin-top: 10px;
|
||||
user-select: none;
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import { inputTypes } from 'Helpers/Props';
|
||||
import FormGroup from 'Components/Form/FormGroup';
|
||||
import FormLabel from 'Components/Form/FormLabel';
|
||||
import FormInputHelpText from 'Components/Form/FormInputHelpText';
|
||||
import FormInputGroup from 'Components/Form/FormInputGroup';
|
||||
import styles from './NotificationEventItems.css';
|
||||
|
||||
function NotificationEventItems(props) {
|
||||
const {
|
||||
item,
|
||||
onInputChange
|
||||
} = props;
|
||||
|
||||
const {
|
||||
onGrab,
|
||||
onReleaseImport,
|
||||
onUpgrade,
|
||||
onRename,
|
||||
onHealthIssue,
|
||||
onDownloadFailure,
|
||||
onImportFailure,
|
||||
onTrackRetag,
|
||||
supportsOnGrab,
|
||||
supportsOnReleaseImport,
|
||||
supportsOnUpgrade,
|
||||
supportsOnRename,
|
||||
supportsOnHealthIssue,
|
||||
includeHealthWarnings,
|
||||
supportsOnDownloadFailure,
|
||||
supportsOnImportFailure,
|
||||
supportsOnTrackRetag
|
||||
} = item;
|
||||
|
||||
return (
|
||||
<FormGroup>
|
||||
<FormLabel>Notification Triggers</FormLabel>
|
||||
<div>
|
||||
<FormInputHelpText
|
||||
text="Select which events should trigger this notification"
|
||||
link="https://github.com/lidarr/Lidarr/wiki/Connections"
|
||||
/>
|
||||
<div className={styles.events}>
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onGrab"
|
||||
helpText="On Grab"
|
||||
isDisabled={!supportsOnGrab.value}
|
||||
{...onGrab}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onReleaseImport"
|
||||
helpText="On Release Import"
|
||||
isDisabled={!supportsOnReleaseImport.value}
|
||||
{...onReleaseImport}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{
|
||||
onReleaseImport.value &&
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onUpgrade"
|
||||
helpText="On Upgrade"
|
||||
isDisabled={!supportsOnUpgrade.value}
|
||||
{...onUpgrade}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onDownloadFailure"
|
||||
helpText="On Download Failure"
|
||||
isDisabled={!supportsOnDownloadFailure.value}
|
||||
{...onDownloadFailure}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onImportFailure"
|
||||
helpText="On Import Failure"
|
||||
isDisabled={!supportsOnImportFailure.value}
|
||||
{...onImportFailure}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onRename"
|
||||
helpText="On Rename"
|
||||
isDisabled={!supportsOnRename.value}
|
||||
{...onRename}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onTrackRetag"
|
||||
helpText="On Track Retag"
|
||||
isDisabled={!supportsOnTrackRetag.value}
|
||||
{...onTrackRetag}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="onHealthIssue"
|
||||
helpText="On Health Issue"
|
||||
isDisabled={!supportsOnHealthIssue.value}
|
||||
{...onHealthIssue}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{
|
||||
onHealthIssue.value &&
|
||||
<div>
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="includeHealthWarnings"
|
||||
helpText="Include Health Warnings"
|
||||
isDisabled={!supportsOnHealthIssue.value}
|
||||
{...includeHealthWarnings}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</FormGroup>
|
||||
);
|
||||
}
|
||||
|
||||
NotificationEventItems.propTypes = {
|
||||
item: PropTypes.object.isRequired,
|
||||
onInputChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default NotificationEventItems;
|
|
@ -103,9 +103,13 @@ export default {
|
|||
[SELECT_NOTIFICATION_SCHEMA]: (state, { payload }) => {
|
||||
return selectProviderSchema(state, section, payload, (selectedSchema) => {
|
||||
selectedSchema.onGrab = selectedSchema.supportsOnGrab;
|
||||
selectedSchema.onDownload = selectedSchema.supportsOnDownload;
|
||||
selectedSchema.onReleaseImport = selectedSchema.supportsOnReleaseImport;
|
||||
selectedSchema.onUpgrade = selectedSchema.supportsOnUpgrade;
|
||||
selectedSchema.onRename = selectedSchema.supportsOnRename;
|
||||
selectedSchema.onHealthIssue = selectedSchema.supportsOnHealthIssue;
|
||||
selectedSchema.onDownloadFailure = selectedSchema.supportsOnDownloadFailure;
|
||||
selectedSchema.onImportFailure = selectedSchema.supportsOnImportFailure;
|
||||
selectedSchema.onTrackRetag = selectedSchema.supportsOnTrackRetag;
|
||||
|
||||
return selectedSchema;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue