Overwrite phash during generate if flag set (#1633)

This commit is contained in:
WithoutPants
2021-08-11 16:08:10 +10:00
committed by GitHub
parent 59c6fe046d
commit c29d8b547d
3 changed files with 4 additions and 1 deletions

View File

@@ -322,6 +322,7 @@ func (s *singleton) Generate(ctx context.Context, input models.GenerateMetadataI
Scene: *scene, Scene: *scene,
fileNamingAlgorithm: fileNamingAlgo, fileNamingAlgorithm: fileNamingAlgo,
txnManager: s.TxnManager, txnManager: s.TxnManager,
Overwrite: overwrite,
} }
wg.Add() wg.Add()
go progress.ExecuteTask(fmt.Sprintf("Generating phash for %s", scene.Path), func() { go progress.ExecuteTask(fmt.Sprintf("Generating phash for %s", scene.Path), func() {

View File

@@ -13,6 +13,7 @@ import (
type GeneratePhashTask struct { type GeneratePhashTask struct {
Scene models.Scene Scene models.Scene
Overwrite bool
fileNamingAlgorithm models.HashAlgorithm fileNamingAlgorithm models.HashAlgorithm
txnManager models.TransactionManager txnManager models.TransactionManager
} }
@@ -58,5 +59,5 @@ func (t *GeneratePhashTask) Start(wg *sizedwaitgroup.SizedWaitGroup) {
} }
func (t *GeneratePhashTask) shouldGenerate() bool { func (t *GeneratePhashTask) shouldGenerate() bool {
return !t.Scene.Phash.Valid return t.Overwrite || !t.Scene.Phash.Valid
} }

View File

@@ -16,6 +16,7 @@
* Added de-DE language option. ([#1578](https://github.com/stashapp/stash/pull/1578)) * Added de-DE language option. ([#1578](https://github.com/stashapp/stash/pull/1578))
### 🐛 Bug fixes ### 🐛 Bug fixes
* Regenerate scene phash if overwrite flag is set. ([#1633](https://github.com/stashapp/stash/pull/1633))
* Create .stash directory in $HOME only if required. ([#1623](https://github.com/stashapp/stash/pull/1623)) * Create .stash directory in $HOME only if required. ([#1623](https://github.com/stashapp/stash/pull/1623))
* Include stash id when scraping performer from stash-box. ([#1608](https://github.com/stashapp/stash/pull/1608)) * Include stash id when scraping performer from stash-box. ([#1608](https://github.com/stashapp/stash/pull/1608))
* Fix infinity framerate values causing resolver error. ([#1607](https://github.com/stashapp/stash/pull/1607)) * Fix infinity framerate values causing resolver error. ([#1607](https://github.com/stashapp/stash/pull/1607))