|
|
@ -42,6 +42,10 @@ const messages = defineMessages({
|
|
|
|
selectQualityProfile: 'Select a Quality Profile',
|
|
|
|
selectQualityProfile: 'Select a Quality Profile',
|
|
|
|
selectRootFolder: 'Select a Root Folder',
|
|
|
|
selectRootFolder: 'Select a Root Folder',
|
|
|
|
selectMinimumAvailability: 'Select minimum availability',
|
|
|
|
selectMinimumAvailability: 'Select minimum availability',
|
|
|
|
|
|
|
|
loadingprofiles: 'Loading quality profiles…',
|
|
|
|
|
|
|
|
testFirstQualityProfiles: 'Test your connection to load quality profiles',
|
|
|
|
|
|
|
|
loadingrootfolders: 'Loading root folders…',
|
|
|
|
|
|
|
|
testFirstRootFolders: 'Test your connection to load root folders',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
interface TestResponse {
|
|
|
|
interface TestResponse {
|
|
|
@ -86,7 +90,9 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
|
|
|
intl.formatMessage(messages.validationPortRequired)
|
|
|
|
intl.formatMessage(messages.validationPortRequired)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
apiKey: Yup.string().required(intl.formatMessage(messages.apiKey)),
|
|
|
|
apiKey: Yup.string().required(intl.formatMessage(messages.apiKey)),
|
|
|
|
rootFolder: Yup.string().required(intl.formatMessage(messages.rootfolder)),
|
|
|
|
rootFolder: Yup.string().required(
|
|
|
|
|
|
|
|
intl.formatMessage(messages.validationRootFolderRequired)
|
|
|
|
|
|
|
|
),
|
|
|
|
activeProfileId: Yup.string().required(
|
|
|
|
activeProfileId: Yup.string().required(
|
|
|
|
intl.formatMessage(messages.validationProfileRequired)
|
|
|
|
intl.formatMessage(messages.validationProfileRequired)
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -179,7 +185,7 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
|
|
|
baseUrl: radarr?.baseUrl,
|
|
|
|
baseUrl: radarr?.baseUrl,
|
|
|
|
activeProfileId: radarr?.activeProfileId,
|
|
|
|
activeProfileId: radarr?.activeProfileId,
|
|
|
|
rootFolder: radarr?.activeDirectory,
|
|
|
|
rootFolder: radarr?.activeDirectory,
|
|
|
|
minimumAvailability: radarr?.minimumAvailability,
|
|
|
|
minimumAvailability: radarr?.minimumAvailability ?? 'released',
|
|
|
|
isDefault: radarr?.isDefault ?? false,
|
|
|
|
isDefault: radarr?.isDefault ?? false,
|
|
|
|
is4k: radarr?.is4k ?? false,
|
|
|
|
is4k: radarr?.is4k ?? false,
|
|
|
|
}}
|
|
|
|
}}
|
|
|
@ -226,6 +232,7 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
|
|
|
handleSubmit,
|
|
|
|
handleSubmit,
|
|
|
|
setFieldValue,
|
|
|
|
setFieldValue,
|
|
|
|
isSubmitting,
|
|
|
|
isSubmitting,
|
|
|
|
|
|
|
|
isValid,
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
<Modal
|
|
|
@ -258,7 +265,7 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
|
|
|
secondaryDisabled={
|
|
|
|
secondaryDisabled={
|
|
|
|
!values.apiKey || !values.hostname || !values.port || isTesting
|
|
|
|
!values.apiKey || !values.hostname || !values.port || isTesting
|
|
|
|
}
|
|
|
|
}
|
|
|
|
okDisabled={!isValidated || isSubmitting || isTesting}
|
|
|
|
okDisabled={!isValidated || isSubmitting || isTesting || !isValid}
|
|
|
|
onOk={() => handleSubmit()}
|
|
|
|
onOk={() => handleSubmit()}
|
|
|
|
title={
|
|
|
|
title={
|
|
|
|
!radarr
|
|
|
|
!radarr
|
|
|
@ -453,10 +460,17 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
|
|
|
as="select"
|
|
|
|
as="select"
|
|
|
|
id="activeProfileId"
|
|
|
|
id="activeProfileId"
|
|
|
|
name="activeProfileId"
|
|
|
|
name="activeProfileId"
|
|
|
|
className="mt-1 form-select rounded-md block w-full pl-3 pr-10 py-2 text-base leading-6 bg-gray-700 border-gray-500 focus:outline-none focus:ring-blue focus:border-gray-500 sm:text-sm sm:leading-5"
|
|
|
|
disabled={!isValidated || isTesting}
|
|
|
|
|
|
|
|
className="mt-1 form-select rounded-md block w-full pl-3 pr-10 py-2 text-base leading-6 bg-gray-700 border-gray-500 focus:outline-none focus:ring-blue focus:border-gray-500 sm:text-sm sm:leading-5 disabled:opacity-50"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<option value="">
|
|
|
|
<option value="">
|
|
|
|
{intl.formatMessage(messages.selectQualityProfile)}
|
|
|
|
{isTesting
|
|
|
|
|
|
|
|
? intl.formatMessage(messages.loadingprofiles)
|
|
|
|
|
|
|
|
: !isValidated
|
|
|
|
|
|
|
|
? intl.formatMessage(
|
|
|
|
|
|
|
|
messages.testFirstQualityProfiles
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: intl.formatMessage(messages.selectQualityProfile)}
|
|
|
|
</option>
|
|
|
|
</option>
|
|
|
|
{testResponse.profiles.length > 0 &&
|
|
|
|
{testResponse.profiles.length > 0 &&
|
|
|
|
testResponse.profiles.map((profile) => (
|
|
|
|
testResponse.profiles.map((profile) => (
|
|
|
@ -489,10 +503,15 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
|
|
|
as="select"
|
|
|
|
as="select"
|
|
|
|
id="rootFolder"
|
|
|
|
id="rootFolder"
|
|
|
|
name="rootFolder"
|
|
|
|
name="rootFolder"
|
|
|
|
className="mt-1 form-select rounded-md block w-full pl-3 pr-10 py-2 text-base leading-6 bg-gray-700 border-gray-500 focus:outline-none focus:ring-blue focus:border-gray-500 sm:text-sm sm:leading-5"
|
|
|
|
disabled={!isValidated || isTesting}
|
|
|
|
|
|
|
|
className="mt-1 form-select rounded-md block w-full pl-3 pr-10 py-2 text-base leading-6 bg-gray-700 border-gray-500 focus:outline-none focus:ring-blue focus:border-gray-500 sm:text-sm sm:leading-5 disabled:opacity-50"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<option value="">
|
|
|
|
<option value="">
|
|
|
|
{intl.formatMessage(messages.selectRootFolder)}
|
|
|
|
{isTesting
|
|
|
|
|
|
|
|
? intl.formatMessage(messages.loadingrootfolders)
|
|
|
|
|
|
|
|
: !isValidated
|
|
|
|
|
|
|
|
? intl.formatMessage(messages.testFirstRootFolders)
|
|
|
|
|
|
|
|
: intl.formatMessage(messages.selectRootFolder)}
|
|
|
|
</option>
|
|
|
|
</option>
|
|
|
|
{testResponse.rootFolders.length > 0 &&
|
|
|
|
{testResponse.rootFolders.length > 0 &&
|
|
|
|
testResponse.rootFolders.map((folder) => (
|
|
|
|
testResponse.rootFolders.map((folder) => (
|
|
|
@ -527,11 +546,6 @@ const RadarrModal: React.FC<RadarrModalProps> = ({
|
|
|
|
name="minimumAvailability"
|
|
|
|
name="minimumAvailability"
|
|
|
|
className="mt-1 form-select rounded-md block w-full pl-3 pr-10 py-2 text-base leading-6 bg-gray-700 border-gray-500 focus:outline-none focus:ring-blue focus:border-gray-500 sm:text-sm sm:leading-5"
|
|
|
|
className="mt-1 form-select rounded-md block w-full pl-3 pr-10 py-2 text-base leading-6 bg-gray-700 border-gray-500 focus:outline-none focus:ring-blue focus:border-gray-500 sm:text-sm sm:leading-5"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<option value="">
|
|
|
|
|
|
|
|
{intl.formatMessage(
|
|
|
|
|
|
|
|
messages.selectMinimumAvailability
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
<option value="announced">Announced</option>
|
|
|
|
<option value="announced">Announced</option>
|
|
|
|
<option value="inCinemas">In Cinemas</option>
|
|
|
|
<option value="inCinemas">In Cinemas</option>
|
|
|
|
<option value="released">Released</option>
|
|
|
|
<option value="released">Released</option>
|
|
|
|