mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Model refactor, part 3 (#4152)
* Remove manager.Repository * Refactor other repositories * Fix tests and add database mock * Add AssertExpectations method * Refactor routes * Move default movie image to internal/static and add convenience methods * Refactor default performer image boxes
This commit is contained in:
@@ -11,10 +11,10 @@ import (
|
||||
)
|
||||
|
||||
type GenerateInteractiveHeatmapSpeedTask struct {
|
||||
repository models.Repository
|
||||
Scene models.Scene
|
||||
Overwrite bool
|
||||
fileNamingAlgorithm models.HashAlgorithm
|
||||
TxnManager Repository
|
||||
}
|
||||
|
||||
func (t *GenerateInteractiveHeatmapSpeedTask) GetDescription() string {
|
||||
@@ -42,10 +42,11 @@ func (t *GenerateInteractiveHeatmapSpeedTask) Start(ctx context.Context) {
|
||||
|
||||
median := generator.InteractiveSpeed
|
||||
|
||||
if err := t.TxnManager.WithTxn(ctx, func(ctx context.Context) error {
|
||||
r := t.repository
|
||||
if err := r.WithTxn(ctx, func(ctx context.Context) error {
|
||||
primaryFile := t.Scene.Files.Primary()
|
||||
primaryFile.InteractiveSpeed = &median
|
||||
qb := t.TxnManager.File
|
||||
qb := r.File
|
||||
return qb.Update(ctx, primaryFile)
|
||||
}); err != nil && ctx.Err() == nil {
|
||||
logger.Error(err.Error())
|
||||
|
||||
Reference in New Issue
Block a user