mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Exclude media in generated directory (#1118)
This commit is contained in:
@@ -41,7 +41,9 @@ func (t *CleanTask) shouldClean(path string) bool {
|
|||||||
// use image.FileExists for zip file checking
|
// use image.FileExists for zip file checking
|
||||||
fileExists := image.FileExists(path)
|
fileExists := image.FileExists(path)
|
||||||
|
|
||||||
if !fileExists || getStashFromPath(path) == nil {
|
// #1102 - clean anything in generated path
|
||||||
|
generatedPath := config.GetGeneratedPath()
|
||||||
|
if !fileExists || getStashFromPath(path) == nil || utils.IsPathInDir(generatedPath, path) {
|
||||||
logger.Infof("File not found. Cleaning: \"%s\"", path)
|
logger.Infof("File not found. Cleaning: \"%s\"", path)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1044,6 +1044,8 @@ func walkFilesToScan(s *models.StashConfig, f filepath.WalkFunc) error {
|
|||||||
excludeVidRegex := generateRegexps(config.GetExcludes())
|
excludeVidRegex := generateRegexps(config.GetExcludes())
|
||||||
excludeImgRegex := generateRegexps(config.GetImageExcludes())
|
excludeImgRegex := generateRegexps(config.GetImageExcludes())
|
||||||
|
|
||||||
|
generatedPath := config.GetGeneratedPath()
|
||||||
|
|
||||||
return utils.SymWalk(s.Path, func(path string, info os.FileInfo, err error) error {
|
return utils.SymWalk(s.Path, func(path string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warnf("error scanning %s: %s", path, err.Error())
|
logger.Warnf("error scanning %s: %s", path, err.Error())
|
||||||
@@ -1051,6 +1053,11 @@ func walkFilesToScan(s *models.StashConfig, f filepath.WalkFunc) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if info.IsDir() {
|
if info.IsDir() {
|
||||||
|
// #1102 - ignore files in generated path
|
||||||
|
if utils.IsPathInDir(generatedPath, path) {
|
||||||
|
return filepath.SkipDir
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
* Support configurable number of threads for scanning and generation.
|
* Support configurable number of threads for scanning and generation.
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
* Exclude media in `generated` directory from the library.
|
||||||
* Prevent cover image from being incorrectly regenerated when a scene file's hash changes.
|
* Prevent cover image from being incorrectly regenerated when a scene file's hash changes.
|
||||||
* Fix version check sometimes giving incorrect results.
|
* Fix version check sometimes giving incorrect results.
|
||||||
* Fixed stash potentially deleting `downloads` directory when first run.
|
* Fixed stash potentially deleting `downloads` directory when first run.
|
||||||
|
|||||||
Reference in New Issue
Block a user