mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Added exclude patterns support for Clean Task (#274)
* Added exclude patterns support for Clean Task * Added test file * Refactoring and cosmetic fixes * * Replace Match with MatchString
This commit is contained in:
@@ -21,8 +21,12 @@ func (t *CleanTask) Start(wg *sync.WaitGroup) {
|
||||
|
||||
if t.fileExists(t.Scene.Path) && t.pathInStash() {
|
||||
logger.Debugf("File Found: %s", t.Scene.Path)
|
||||
if matchFile(t.Scene.Path, config.GetExcludes()) {
|
||||
logger.Infof("File matched regex. Cleaning: \"%s\"", t.Scene.Path)
|
||||
t.deleteScene(t.Scene.ID)
|
||||
}
|
||||
} else {
|
||||
logger.Infof("File not found. Cleaning: %s", t.Scene.Path)
|
||||
logger.Infof("File not found. Cleaning: \"%s\"", t.Scene.Path)
|
||||
t.deleteScene(t.Scene.ID)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user