From 4104f3dadd48b055707f8e61ae69016e5de2acf2 Mon Sep 17 00:00:00 2001 From: TOomaAh Date: Tue, 21 Jan 2025 20:42:59 +0100 Subject: [PATCH] refactor(medata): add tvdb settings --- jellyseerr-api.yml | 4 +- src/components/Settings/SettingsMetadata.tsx | 40 +++++++++++++------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/jellyseerr-api.yml b/jellyseerr-api.yml index e59d4995d..56887e119 100644 --- a/jellyseerr-api.yml +++ b/jellyseerr-api.yml @@ -2625,9 +2625,9 @@ paths: application/json: schema: $ref: '#/components/schemas/MetadataSettings' - /settings/tvdb/test: + /settings/metadatas/test: post: - summary: Test TVDB configuration + summary: Test Provider configuration description: Tests if the TVDB configuration is valid. Returns a list of available languages on success. tags: - settings diff --git a/src/components/Settings/SettingsMetadata.tsx b/src/components/Settings/SettingsMetadata.tsx index afb292fb8..4a31d6066 100644 --- a/src/components/Settings/SettingsMetadata.tsx +++ b/src/components/Settings/SettingsMetadata.tsx @@ -1,7 +1,6 @@ import Button from '@app/components/Common/Button'; import LoadingSpinner from '@app/components/Common/LoadingSpinner'; import PageTitle from '@app/components/Common/PageTitle'; -import SettingsBadge from '@app/components/Settings/SettingsBadge'; import globalMessages from '@app/i18n/globalMessages'; import defineMessages from '@app/utils/defineMessages'; import { ArrowDownOnSquareIcon, BeakerIcon } from '@heroicons/react/24/outline'; @@ -57,7 +56,7 @@ const SettingsMetadata = () => { const { addToast } = useToasts(); const testConnection = async () => { - const response = await fetch('/api/v1/settings/metadats/test', { + const response = await fetch('/api/v1/settings/metadatas/test', { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -67,8 +66,10 @@ const SettingsMetadata = () => { const body = (await response.json()) as providerResponse; if (!response.ok) { - console.log(body); + throw new Error('Failed to test Tvdb connection'); } + + console.log(body); }; const saveSettings = async ( @@ -106,7 +107,6 @@ const SettingsMetadata = () => { ]} />
- me

{'Metadata'}

{'Settings for metadata indexer'}

@@ -151,15 +151,18 @@ const SettingsMetadata = () => { addToast('Tvdb settings saved', { appearance: 'success' }); }} > - {({ isSubmitting, isValid, values, setFieldValue }) => { + {({ isSubmitting, isValid, values }) => { return (
+
+

{'TVDB'}

+

{'Settings for TVDB indexer'}

+
+
+ + +
+ +
{ - setFieldValue('pin', values.providers.tvdb.pin); + onChange={(e: React.ChangeEvent) => { + values.providers.tvdb.pin = e.target.value; }} />