Don't regenerate covers if present during scan (#3646)

* Don't regenerate covers if present during scan
* Fix performer unit test (unrelated)
This commit is contained in:
WithoutPants
2023-04-07 11:57:10 +10:00
committed by GitHub
parent a6ef924d06
commit 0cd0151251
3 changed files with 19 additions and 7 deletions

View File

@@ -23,12 +23,19 @@ func (t *GenerateCoverTask) GetDescription() string {
func (t *GenerateCoverTask) Start(ctx context.Context) {
scenePath := t.Scene.Path
var required bool
if err := t.txnManager.WithReadTxn(ctx, func(ctx context.Context) error {
// don't generate the screenshot if it already exists
required = t.required(ctx)
return t.Scene.LoadPrimaryFile(ctx, t.txnManager.File)
}); err != nil {
logger.Error(err)
}
if !required {
return
}
videoFile := t.Scene.Files.Primary()
if videoFile == nil {
return