mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Allow setting metadata directory from UI (#1782)
This commit is contained in:
@@ -6,6 +6,7 @@ fragment ConfigGeneralData on ConfigGeneralResult {
|
|||||||
}
|
}
|
||||||
databasePath
|
databasePath
|
||||||
generatedPath
|
generatedPath
|
||||||
|
metadataPath
|
||||||
cachePath
|
cachePath
|
||||||
calculateMD5
|
calculateMD5
|
||||||
videoFileNamingAlgorithm
|
videoFileNamingAlgorithm
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ input ConfigGeneralInput {
|
|||||||
databasePath: String
|
databasePath: String
|
||||||
"""Path to generated files"""
|
"""Path to generated files"""
|
||||||
generatedPath: String
|
generatedPath: String
|
||||||
|
"""Path to import/export files"""
|
||||||
|
metadataPath: String
|
||||||
"""Path to cache"""
|
"""Path to cache"""
|
||||||
cachePath: String
|
cachePath: String
|
||||||
"""Whether to calculate MD5 checksums for scene video files"""
|
"""Whether to calculate MD5 checksums for scene video files"""
|
||||||
@@ -110,6 +112,8 @@ type ConfigGeneralResult {
|
|||||||
databasePath: String!
|
databasePath: String!
|
||||||
"""Path to generated files"""
|
"""Path to generated files"""
|
||||||
generatedPath: String!
|
generatedPath: String!
|
||||||
|
"""Path to import/export files"""
|
||||||
|
metadataPath: String!
|
||||||
"""Path to the config file used"""
|
"""Path to the config file used"""
|
||||||
configFilePath: String!
|
configFilePath: String!
|
||||||
"""Path to scrapers"""
|
"""Path to scrapers"""
|
||||||
|
|||||||
@@ -61,6 +61,15 @@ func (r *mutationResolver) ConfigureGeneral(ctx context.Context, input models.Co
|
|||||||
c.Set(config.Generated, input.GeneratedPath)
|
c.Set(config.Generated, input.GeneratedPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if input.MetadataPath != nil {
|
||||||
|
if *input.MetadataPath != "" {
|
||||||
|
if err := utils.EnsureDir(*input.MetadataPath); err != nil {
|
||||||
|
return makeConfigGeneralResult(), err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c.Set(config.Metadata, input.MetadataPath)
|
||||||
|
}
|
||||||
|
|
||||||
if input.CachePath != nil {
|
if input.CachePath != nil {
|
||||||
if *input.CachePath != "" {
|
if *input.CachePath != "" {
|
||||||
if err := utils.EnsureDir(*input.CachePath); err != nil {
|
if err := utils.EnsureDir(*input.CachePath); err != nil {
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ func makeConfigGeneralResult() *models.ConfigGeneralResult {
|
|||||||
Stashes: config.GetStashPaths(),
|
Stashes: config.GetStashPaths(),
|
||||||
DatabasePath: config.GetDatabasePath(),
|
DatabasePath: config.GetDatabasePath(),
|
||||||
GeneratedPath: config.GetGeneratedPath(),
|
GeneratedPath: config.GetGeneratedPath(),
|
||||||
|
MetadataPath: config.GetMetadataPath(),
|
||||||
ConfigFilePath: config.GetConfigFilePath(),
|
ConfigFilePath: config.GetConfigFilePath(),
|
||||||
ScrapersPath: config.GetScrapersPath(),
|
ScrapersPath: config.GetScrapersPath(),
|
||||||
CachePath: config.GetCachePath(),
|
CachePath: config.GetCachePath(),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
* Support filtering Movies by Performers. ([#1675](https://github.com/stashapp/stash/pull/1675))
|
* Support filtering Movies by Performers. ([#1675](https://github.com/stashapp/stash/pull/1675))
|
||||||
|
|
||||||
### 🎨 Improvements
|
### 🎨 Improvements
|
||||||
|
* Support setting metadata import/export directory from UI. ([#1782](https://github.com/stashapp/stash/pull/1782))
|
||||||
* Improved image query performance. ([#1750](https://github.com/stashapp/stash/pull/1750))
|
* Improved image query performance. ([#1750](https://github.com/stashapp/stash/pull/1750))
|
||||||
* Added movie count to performer and studio cards. ([#1760](https://github.com/stashapp/stash/pull/1760))
|
* Added movie count to performer and studio cards. ([#1760](https://github.com/stashapp/stash/pull/1760))
|
||||||
* Added date and details to Movie card, and move scene count to icon. ([#1758](https://github.com/stashapp/stash/pull/1758))
|
* Added date and details to Movie card, and move scene count to icon. ([#1758](https://github.com/stashapp/stash/pull/1758))
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
|||||||
const [generatedPath, setGeneratedPath] = useState<string | undefined>(
|
const [generatedPath, setGeneratedPath] = useState<string | undefined>(
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
|
const [metadataPath, setMetadataPath] = useState<string | undefined>(
|
||||||
|
undefined
|
||||||
|
);
|
||||||
const [cachePath, setCachePath] = useState<string | undefined>(undefined);
|
const [cachePath, setCachePath] = useState<string | undefined>(undefined);
|
||||||
const [calculateMD5, setCalculateMD5] = useState<boolean>(false);
|
const [calculateMD5, setCalculateMD5] = useState<boolean>(false);
|
||||||
const [videoFileNamingAlgorithm, setVideoFileNamingAlgorithm] = useState<
|
const [videoFileNamingAlgorithm, setVideoFileNamingAlgorithm] = useState<
|
||||||
@@ -145,6 +148,7 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
|||||||
})),
|
})),
|
||||||
databasePath,
|
databasePath,
|
||||||
generatedPath,
|
generatedPath,
|
||||||
|
metadataPath,
|
||||||
cachePath,
|
cachePath,
|
||||||
calculateMD5,
|
calculateMD5,
|
||||||
videoFileNamingAlgorithm:
|
videoFileNamingAlgorithm:
|
||||||
@@ -191,6 +195,7 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
|||||||
setStashes(conf.general.stashes ?? []);
|
setStashes(conf.general.stashes ?? []);
|
||||||
setDatabasePath(conf.general.databasePath);
|
setDatabasePath(conf.general.databasePath);
|
||||||
setGeneratedPath(conf.general.generatedPath);
|
setGeneratedPath(conf.general.generatedPath);
|
||||||
|
setMetadataPath(conf.general.metadataPath);
|
||||||
setCachePath(conf.general.cachePath);
|
setCachePath(conf.general.cachePath);
|
||||||
setVideoFileNamingAlgorithm(conf.general.videoFileNamingAlgorithm);
|
setVideoFileNamingAlgorithm(conf.general.videoFileNamingAlgorithm);
|
||||||
setCalculateMD5(conf.general.calculateMD5);
|
setCalculateMD5(conf.general.calculateMD5);
|
||||||
@@ -423,6 +428,24 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
|||||||
</Form.Text>
|
</Form.Text>
|
||||||
</Form.Group>
|
</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">
|
<Form.Group id="cache-path">
|
||||||
<h6>
|
<h6>
|
||||||
<FormattedMessage id="config.general.cache_path_head" />
|
<FormattedMessage id="config.general.cache_path_head" />
|
||||||
|
|||||||
@@ -228,6 +228,10 @@
|
|||||||
"maximum_streaming_transcode_size_head": "Maximum streaming transcode size",
|
"maximum_streaming_transcode_size_head": "Maximum streaming transcode size",
|
||||||
"maximum_transcode_size_desc": "Maximum size for generated transcodes",
|
"maximum_transcode_size_desc": "Maximum size for generated transcodes",
|
||||||
"maximum_transcode_size_head": "Maximum transcode size",
|
"maximum_transcode_size_head": "Maximum transcode size",
|
||||||
|
"metadata_path": {
|
||||||
|
"heading": "Metadata Path",
|
||||||
|
"description": "Directory location used when performing a full export or import"
|
||||||
|
},
|
||||||
"number_of_parallel_task_for_scan_generation_desc": "Set to 0 for auto-detection. Warning running more tasks than is required to achieve 100% cpu utilisation will decrease performance and potentially cause other issues.",
|
"number_of_parallel_task_for_scan_generation_desc": "Set to 0 for auto-detection. Warning running more tasks than is required to achieve 100% cpu utilisation will decrease performance and potentially cause other issues.",
|
||||||
"number_of_parallel_task_for_scan_generation_head": "Number of parallel task for scan/generation",
|
"number_of_parallel_task_for_scan_generation_head": "Number of parallel task for scan/generation",
|
||||||
"parallel_scan_head": "Parallel Scan/Generation",
|
"parallel_scan_head": "Parallel Scan/Generation",
|
||||||
|
|||||||
Reference in New Issue
Block a user