mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Skip validation of existing paths when adding new paths (#1301)
This commit is contained in:
@@ -25,13 +25,24 @@ func (r *mutationResolver) Migrate(ctx context.Context, input models.MigrateInpu
|
|||||||
|
|
||||||
func (r *mutationResolver) ConfigureGeneral(ctx context.Context, input models.ConfigGeneralInput) (*models.ConfigGeneralResult, error) {
|
func (r *mutationResolver) ConfigureGeneral(ctx context.Context, input models.ConfigGeneralInput) (*models.ConfigGeneralResult, error) {
|
||||||
c := config.GetInstance()
|
c := config.GetInstance()
|
||||||
|
existingPaths := c.GetStashPaths()
|
||||||
if len(input.Stashes) > 0 {
|
if len(input.Stashes) > 0 {
|
||||||
for _, s := range input.Stashes {
|
for _, s := range input.Stashes {
|
||||||
|
// Only validate existence of new paths
|
||||||
|
isNew := true
|
||||||
|
for _, path := range existingPaths {
|
||||||
|
if path.Path == s.Path {
|
||||||
|
isNew = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if isNew {
|
||||||
exists, err := utils.DirExists(s.Path)
|
exists, err := utils.DirExists(s.Path)
|
||||||
if !exists {
|
if !exists {
|
||||||
return makeConfigGeneralResult(), err
|
return makeConfigGeneralResult(), err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
c.Set(config.Stash, input.Stashes)
|
c.Set(config.Stash, input.Stashes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* Change performer text query to search by name and alias only.
|
* Change performer text query to search by name and alias only.
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
* Fix error preventing adding a new library path when an existing library path is missing.
|
||||||
* Fix whitespace in query string returning all objects.
|
* Fix whitespace in query string returning all objects.
|
||||||
* Fix hang on Login page when not connected to internet.
|
* Fix hang on Login page when not connected to internet.
|
||||||
* Fix `Clear Image` button not updating image preview.
|
* Fix `Clear Image` button not updating image preview.
|
||||||
|
|||||||
Reference in New Issue
Block a user