Allow setting metadata directory from UI (#1782)

This commit is contained in:
WithoutPants
2021-10-03 11:35:30 +11:00
committed by GitHub
parent 52193586de
commit 7464454da5
7 changed files with 43 additions and 0 deletions

View File

@@ -80,6 +80,9 @@ export const SettingsConfigurationPanel: React.FC = () => {
const [generatedPath, setGeneratedPath] = useState<string | undefined>(
undefined
);
const [metadataPath, setMetadataPath] = useState<string | undefined>(
undefined
);
const [cachePath, setCachePath] = useState<string | undefined>(undefined);
const [calculateMD5, setCalculateMD5] = useState<boolean>(false);
const [videoFileNamingAlgorithm, setVideoFileNamingAlgorithm] = useState<
@@ -145,6 +148,7 @@ export const SettingsConfigurationPanel: React.FC = () => {
})),
databasePath,
generatedPath,
metadataPath,
cachePath,
calculateMD5,
videoFileNamingAlgorithm:
@@ -191,6 +195,7 @@ export const SettingsConfigurationPanel: React.FC = () => {
setStashes(conf.general.stashes ?? []);
setDatabasePath(conf.general.databasePath);
setGeneratedPath(conf.general.generatedPath);
setMetadataPath(conf.general.metadataPath);
setCachePath(conf.general.cachePath);
setVideoFileNamingAlgorithm(conf.general.videoFileNamingAlgorithm);
setCalculateMD5(conf.general.calculateMD5);
@@ -423,6 +428,24 @@ export const SettingsConfigurationPanel: React.FC = () => {
</Form.Text>
</Form.Group>
<Form.Group id="metadata-path">
<h6>
<FormattedMessage id="config.general.metadata_path.heading" />
</h6>
<Form.Control
className="col col-sm-6 text-input"
defaultValue={metadataPath}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setMetadataPath(e.currentTarget.value)
}
/>
<Form.Text className="text-muted">
{intl.formatMessage({
id: "config.general.metadata_path.description",
})}
</Form.Text>
</Form.Group>
<Form.Group id="cache-path">
<h6>
<FormattedMessage id="config.general.cache_path_head" />