mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add Dry Run option to clean task (#1081)
This commit is contained in:
@@ -783,7 +783,7 @@ func (s *singleton) autoTagTags(tagIds []string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *singleton) Clean() {
|
||||
func (s *singleton) Clean(input models.CleanMetadataInput) {
|
||||
if s.Status.Status != Idle {
|
||||
return
|
||||
}
|
||||
@@ -803,8 +803,13 @@ func (s *singleton) Clean() {
|
||||
gqb := r.Gallery()
|
||||
|
||||
logger.Infof("Starting cleaning of tracked files")
|
||||
if input.DryRun {
|
||||
logger.Infof("Running in Dry Mode")
|
||||
}
|
||||
var err error
|
||||
|
||||
scenes, err = qb.All()
|
||||
|
||||
if err != nil {
|
||||
return errors.New("failed to fetch list of scenes for cleaning")
|
||||
}
|
||||
@@ -853,7 +858,7 @@ func (s *singleton) Clean() {
|
||||
Scene: scene,
|
||||
fileNamingAlgorithm: fileNamingAlgo,
|
||||
}
|
||||
go task.Start(&wg)
|
||||
go task.Start(&wg, input.DryRun)
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
@@ -875,7 +880,7 @@ func (s *singleton) Clean() {
|
||||
TxnManager: s.TxnManager,
|
||||
Image: img,
|
||||
}
|
||||
go task.Start(&wg)
|
||||
go task.Start(&wg, input.DryRun)
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
@@ -897,7 +902,7 @@ func (s *singleton) Clean() {
|
||||
TxnManager: s.TxnManager,
|
||||
Gallery: gallery,
|
||||
}
|
||||
go task.Start(&wg)
|
||||
go task.Start(&wg, input.DryRun)
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user