mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-15 08:15:37 +00:00
* Implement #636 * Fix potential bug in Regex parsing Add validation in UI Adjust log entries
This commit is contained in:
@@ -45,8 +45,11 @@ function LibraryManagementLayout({getConfig, formik}: any) {
|
||||
<ConfigFormField configElement={getConfig("library.scan.enable-filesystem-watcher")} isDisabled/>
|
||||
<ConfigFormField configElement={getConfig("library.scan.scan-empty-directories")}/>
|
||||
<div className="flex flex-row gap-4 items-baseline">
|
||||
<ConfigFormField configElement={getConfig("library.scan.title-match-min-ratio")}/>
|
||||
<ConfigFormField configElement={getConfig("library.scan.extract-title-using-regex")}/>
|
||||
<ConfigFormField configElement={getConfig("library.scan.title-extraction-regex")}
|
||||
isDisabled={!formik.values.library.scan["extract-title-using-regex"]}/>
|
||||
</div>
|
||||
<ConfigFormField configElement={getConfig("library.scan.title-match-min-ratio")}/>
|
||||
<ConfigFormField configElement={getConfig("library.scan.game-file-extensions")}/>
|
||||
</div>
|
||||
|
||||
@@ -95,6 +98,14 @@ const validationSchema = Yup.object({
|
||||
// @ts-ignore
|
||||
schedule: Yup.string().cron()
|
||||
})
|
||||
}),
|
||||
scan: Yup.object({
|
||||
"extract-title-using-regex": Yup.boolean(),
|
||||
"title-extraction-regex": Yup.string().when("extract-title-using-regex", {
|
||||
is: true,
|
||||
then: (schema) => schema.trim().required("Title extraction regex is required when enabled")
|
||||
}),
|
||||
"title-match-min-ratio": Yup.number().min(1, "Must be between 1-100").max(100, "Must be between 1-100")
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user