mirror of
https://github.com/stashapp/stash.git
synced 2025-12-10 10:22:18 +01:00
Fix image clean (#913)
* Use correct regex when cleaning images * Clarify video exclusion pattern heading
This commit is contained in:
parent
bae82513eb
commit
cbfd9e82b7
2 changed files with 17 additions and 8 deletions
|
|
@ -41,13 +41,7 @@ func (t *CleanTask) shouldClean(path string) bool {
|
|||
// use image.FileExists for zip file checking
|
||||
fileExists := image.FileExists(path)
|
||||
|
||||
if fileExists && t.getStashFromPath(path) != nil {
|
||||
logger.Debugf("File Found: %s", path)
|
||||
if matchFile(path, config.GetExcludes()) {
|
||||
logger.Infof("File matched regex. Cleaning: \"%s\"", path)
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
if !fileExists || t.getStashFromPath(path) == nil {
|
||||
logger.Infof("File not found. Cleaning: \"%s\"", path)
|
||||
return true
|
||||
}
|
||||
|
|
@ -71,6 +65,11 @@ func (t *CleanTask) shouldCleanScene(s *models.Scene) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
if matchFile(s.Path, config.GetExcludes()) {
|
||||
logger.Infof("File matched regex. Cleaning: \"%s\"", s.Path)
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -96,6 +95,11 @@ func (t *CleanTask) shouldCleanGallery(g *models.Gallery) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
if matchFile(path, config.GetImageExcludes()) {
|
||||
logger.Infof("File matched regex. Cleaning: \"%s\"", path)
|
||||
return true
|
||||
}
|
||||
|
||||
if countImagesInZip(path) == 0 {
|
||||
logger.Infof("Gallery has 0 images. Cleaning: \"%s\"", path)
|
||||
return true
|
||||
|
|
@ -120,6 +124,11 @@ func (t *CleanTask) shouldCleanImage(s *models.Image) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
if matchFile(s.Path, config.GetImageExcludes()) {
|
||||
logger.Infof("File matched regex. Cleaning: \"%s\"", s.Path)
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ export const SettingsConfigurationPanel: React.FC = () => {
|
|||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<h6>Excluded Patterns</h6>
|
||||
<h6>Excluded Video Patterns</h6>
|
||||
<ExclusionPatterns excludes={excludes} setExcludes={setExcludes} />
|
||||
<Form.Text className="text-muted">
|
||||
Regexps of video files/paths to exclude from Scan and add to Clean
|
||||
|
|
|
|||
Loading…
Reference in a new issue