fix(lists): plaintext only accept URLs (#1901)

fix(web): update plaintext list form to only accept URLs
This commit is contained in:
soup 2024-12-27 15:56:27 +01:00 committed by GitHub
parent c1c97d2d97
commit 0104ca4a28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -678,8 +678,6 @@ function ListTypeTrakt() {
} }
function ListTypePlainText() { function ListTypePlainText() {
const { values } = useFormikContext<List>();
return ( return (
<div className="border-t border-gray-200 dark:border-gray-700 py-4"> <div className="border-t border-gray-200 dark:border-gray-700 py-4">
<div className="px-4 space-y-1"> <div className="px-4 space-y-1">
@ -687,25 +685,17 @@ function ListTypePlainText() {
Source list Source list
</DialogTitle> </DialogTitle>
<p className="text-sm text-gray-500 dark:text-gray-400"> <p className="text-sm text-gray-500 dark:text-gray-400">
Use a Trakt list or one of the default autobrr hosted lists. Use a plain text list with one item per line.
</p> </p>
</div> </div>
<SelectFieldCreatable <TextFieldWide
name="url" name="url"
label="List URL" label="List URL"
help="Default Trakt lists. Override with your own." help="URL to a plain text file with one item per line"
options={ListsTraktOptions.map(u => ({ value: u.value, label: u.label, key: u.label }))} placeholder="https://example.com/list.txt"
/> />
{!values.url.startsWith("https://api.autobrr.com/") && (
<PasswordFieldWide
name="api_key"
label="API Key"
help="Trakt API Key. Required for private lists."
/>
)}
<div className="space-y-1"> <div className="space-y-1">
<fieldset> <fieldset>
<legend className="sr-only">Settings</legend> <legend className="sr-only">Settings</legend>